Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
brindy committed Oct 6, 2023
1 parent 90c3859 commit 8a29a24
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
9 changes: 2 additions & 7 deletions DuckDuckGo/MainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions DuckDuckGo/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8a29a24

Please sign in to comment.