From 45cba8b06bb3068dac35c5f8130b5783cba546ca Mon Sep 17 00:00:00 2001 From: Ian Dundas <1131967+iandundas@users.noreply.github.com> Date: Thu, 12 Jan 2023 10:22:58 +0100 Subject: [PATCH 1/2] rename confusing var --- .../Interface/Common/ScrolledStackView.swift | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Sources/CTR/Interface/Common/ScrolledStackView.swift b/Sources/CTR/Interface/Common/ScrolledStackView.swift index 777922ee6..56083df22 100644 --- a/Sources/CTR/Interface/Common/ScrolledStackView.swift +++ b/Sources/CTR/Interface/Common/ScrolledStackView.swift @@ -50,7 +50,7 @@ class ScrolledStackView: BaseView { }() /// Content view to get proper size in scroll view - let contentScrollView: UIView = { + let scrollViewContent: UIView = { let view = UIView() view.translatesAutoresizingMaskIntoConstraints = false return view @@ -60,8 +60,8 @@ class ScrolledStackView: BaseView { override func setupViewHierarchy() { super.setupViewHierarchy() - stackView.embed(in: contentScrollView) - scrollView.addSubview(contentScrollView) + stackView.embed(in: scrollViewContent) + scrollView.addSubview(scrollViewContent) addSubview(scrollView) } @@ -85,15 +85,15 @@ class ScrolledStackView: BaseView { }(), // Content view - contentScrollView.leadingAnchor.constraint(equalTo: scrollView.leadingAnchor, constant: stackViewInset.left), - contentScrollView.trailingAnchor.constraint(equalTo: scrollView.trailingAnchor, constant: -stackViewInset.right), - contentScrollView.topAnchor.constraint(equalTo: scrollView.topAnchor, constant: stackViewInset.top), - contentScrollView.bottomAnchor.constraint(equalTo: scrollView.bottomAnchor, constant: -stackViewInset.bottom), - contentScrollView.widthAnchor.constraint(equalTo: scrollView.widthAnchor, constant: -stackViewInset.left - stackViewInset.right), + scrollViewContent.leadingAnchor.constraint(equalTo: scrollView.leadingAnchor, constant: stackViewInset.left), + scrollViewContent.trailingAnchor.constraint(equalTo: scrollView.trailingAnchor, constant: -stackViewInset.right), + scrollViewContent.topAnchor.constraint(equalTo: scrollView.topAnchor, constant: stackViewInset.top), + scrollViewContent.bottomAnchor.constraint(equalTo: scrollView.bottomAnchor, constant: -stackViewInset.bottom), + scrollViewContent.widthAnchor.constraint(equalTo: scrollView.widthAnchor, constant: -stackViewInset.left - stackViewInset.right), // StackView - stackView.widthAnchor.constraint(equalTo: contentScrollView.widthAnchor), - stackView.centerXAnchor.constraint(equalTo: contentScrollView.centerXAnchor) + stackView.widthAnchor.constraint(equalTo: scrollViewContent.widthAnchor), + stackView.centerXAnchor.constraint(equalTo: scrollViewContent.centerXAnchor) ]) } } From cff49458bb840105bade38bfa370d8e88cf316a3 Mon Sep 17 00:00:00 2001 From: Ian Dundas <1131967+iandundas@users.noreply.github.com> Date: Thu, 12 Jan 2023 10:43:34 +0100 Subject: [PATCH 2/2] Fix horizontal scrolling --- Sources/CTR/Interface/Common/ScrolledStackView.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Sources/CTR/Interface/Common/ScrolledStackView.swift b/Sources/CTR/Interface/Common/ScrolledStackView.swift index 56083df22..f64ff1bd1 100644 --- a/Sources/CTR/Interface/Common/ScrolledStackView.swift +++ b/Sources/CTR/Interface/Common/ScrolledStackView.swift @@ -86,7 +86,6 @@ class ScrolledStackView: BaseView { // Content view scrollViewContent.leadingAnchor.constraint(equalTo: scrollView.leadingAnchor, constant: stackViewInset.left), - scrollViewContent.trailingAnchor.constraint(equalTo: scrollView.trailingAnchor, constant: -stackViewInset.right), scrollViewContent.topAnchor.constraint(equalTo: scrollView.topAnchor, constant: stackViewInset.top), scrollViewContent.bottomAnchor.constraint(equalTo: scrollView.bottomAnchor, constant: -stackViewInset.bottom), scrollViewContent.widthAnchor.constraint(equalTo: scrollView.widthAnchor, constant: -stackViewInset.left - stackViewInset.right),