From 8a29a2496eef1597ed17f78f15c22196f8ba750f Mon Sep 17 00:00:00 2001 From: Chris Brind Date: Fri, 6 Oct 2023 16:35:38 +0100 Subject: [PATCH] clean up --- DuckDuckGo/MainView.swift | 9 ++------- DuckDuckGo/MainViewController.swift | 4 ++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/DuckDuckGo/MainView.swift b/DuckDuckGo/MainView.swift index 4dcc981f72..91ebbeba4d 100644 --- a/DuckDuckGo/MainView.swift +++ b/DuckDuckGo/MainView.swift @@ -34,16 +34,11 @@ class MainViewFactory { coordinator = MainViewCoordinator(superview: superview) } - static func createViewHierarchy(_ superview: UIView, addressBarPosition: AddressBarPosition) -> MainViewCoordinator { + static func createViewHierarchy(_ superview: UIView) -> MainViewCoordinator { let factory = MainViewFactory(superview) - factory.createViews() - factory.disableAutoresizingOnViewAndImmediateSubviews(superview) factory.constrainViews() - - let coordinator = factory.coordinator - coordinator.moveAddressBarToPosition(addressBarPosition) - return coordinator + return factory.coordinator } private func disableAutoresizingOnViewAndImmediateSubviews(_ view: UIView) { diff --git a/DuckDuckGo/MainViewController.swift b/DuckDuckGo/MainViewController.swift index 15ebc4c697..be42b10b9b 100644 --- a/DuckDuckGo/MainViewController.swift +++ b/DuckDuckGo/MainViewController.swift @@ -178,8 +178,8 @@ class MainViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() - viewCoordinator = MainViewFactory.createViewHierarchy(self.view, - addressBarPosition: appSettings.currentAddressBarPosition) + viewCoordinator = MainViewFactory.createViewHierarchy(self.view) + viewCoordinator.moveAddressBarToPosition(appSettings.currentAddressBarPosition) viewCoordinator.toolbarBackButton.action = #selector(onBackPressed) viewCoordinator.toolbarForwardButton.action = #selector(onForwardPressed)