diff --git a/DuckDuckGo/SettingsHostingController.swift b/DuckDuckGo/SettingsHostingController.swift index 5117884b27..1d5f873207 100644 --- a/DuckDuckGo/SettingsHostingController.swift +++ b/DuckDuckGo/SettingsHostingController.swift @@ -27,7 +27,7 @@ import Subscription class SettingsHostingController: UIHostingController { var viewModel: SettingsViewModel var viewProvider: SettingsLegacyViewProvider - + init(viewModel: SettingsViewModel, viewProvider: SettingsLegacyViewProvider) { self.viewModel = viewModel self.viewProvider = viewProvider @@ -36,15 +36,15 @@ class SettingsHostingController: UIHostingController { viewModel.onRequestPushLegacyView = { [weak self] vc in self?.pushLegacyViewController(vc) } - + viewModel.onRequestPresentLegacyView = { [weak self] vc, modal in self?.presentLegacyViewController(vc, modal: modal) } - + viewModel.onRequestPopLegacyView = { [weak self] in self?.navigationController?.popViewController(animated: true) } - + viewModel.onRequestDismissSettings = { [weak self] in self?.navigationController?.dismiss(animated: true) } @@ -56,7 +56,7 @@ class SettingsHostingController: UIHostingController { } self.rootView = AnyView(settingsView) - decorate() + decorateNavigationBar() } override func viewDidAppear(_ animated: Bool) { @@ -64,7 +64,7 @@ class SettingsHostingController: UIHostingController { // If this is not called, settings navigation bar (UIKIt) is going wild with colors after reopening settings (?!) // Root cause will be investigated later as part of https://app.asana.com/0/414235014887631/1207098219526666/f - decorate() + decorateNavigationBar() } required init?(coder aDecoder: NSCoder) { @@ -74,7 +74,7 @@ class SettingsHostingController: UIHostingController { func pushLegacyViewController(_ vc: UIViewController) { navigationController?.pushViewController(vc, animated: true) } - + func presentLegacyViewController(_ vc: UIViewController, modal: Bool = false) { if modal { vc.modalPresentationStyle = .fullScreen @@ -82,11 +82,3 @@ class SettingsHostingController: UIHostingController { navigationController?.present(vc, animated: true) } } - -extension SettingsHostingController { - - private func decorate() { - decorateNavigationBar() - } - -}