From 6b78309af6e6ebd6fe9baf0027ddcfa02df5325e Mon Sep 17 00:00:00 2001 From: Dariusz Rybicki <dariusz@elixxir.io> Date: Thu, 8 Dec 2022 10:59:46 +0100 Subject: [PATCH] Update scroll view setup in ProfileCodeController --- .../Controllers/ProfileCodeController.swift | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Sources/ProfileFeature/Controllers/ProfileCodeController.swift b/Sources/ProfileFeature/Controllers/ProfileCodeController.swift index a291ea8f..3e8c2fec 100644 --- a/Sources/ProfileFeature/Controllers/ProfileCodeController.swift +++ b/Sources/ProfileFeature/Controllers/ProfileCodeController.swift @@ -60,14 +60,20 @@ public final class ProfileCodeController: UIViewController { } private func setupScrollView() { + scrollViewController.contentView = screenView + scrollViewController.scrollView.backgroundColor = Asset.neutralWhite.color addChild(scrollViewController) view.addSubview(scrollViewController.view) - scrollViewController.view.snp.makeConstraints { - $0.edges.equalToSuperview() - } + scrollViewController.view.translatesAutoresizingMaskIntoConstraints = false + NSLayoutConstraint.activate([ + scrollViewController.view.topAnchor.constraint(equalTo: view.topAnchor), + scrollViewController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor), + scrollViewController.view.leftAnchor.constraint(equalTo: view.leftAnchor), + scrollViewController.view.rightAnchor.constraint(equalTo: view.rightAnchor), + ]) + view.setNeedsLayout() + view.layoutIfNeeded() scrollViewController.didMove(toParent: self) - scrollViewController.contentView = screenView - scrollViewController.scrollView.backgroundColor = Asset.neutralWhite.color } private func setupBindings() { -- GitLab