diff --git a/Passepartout-iOS/AppDelegate.swift b/Passepartout-iOS/AppDelegate.swift index 2cfd786f..9419c868 100644 --- a/Passepartout-iOS/AppDelegate.swift +++ b/Passepartout-iOS/AppDelegate.swift @@ -142,7 +142,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele wizard.parsingResult = parsingResult wizard.removesConfigurationOnCancel = true - wizardNav.modalPresentationStyle = .formSheet + wizardNav.applyModalPresentation(.current) target.present(wizardNav, animated: true, completion: nil) } } diff --git a/Passepartout-iOS/Global/Theme+Titles.swift b/Passepartout-iOS/Global/Theme+Titles.swift index 38b11ab4..92bba2a8 100644 --- a/Passepartout-iOS/Global/Theme+Titles.swift +++ b/Passepartout-iOS/Global/Theme+Titles.swift @@ -26,16 +26,6 @@ import UIKit import Convenience -extension UIViewController { - func applyMasterTitle(_ theme: Theme) { - navigationItem.largeTitleDisplayMode = theme.masterTitleDisplayMode - } - - func applyDetailTitle(_ theme: Theme) { - navigationItem.largeTitleDisplayMode = theme.detailTitleDisplayMode - } -} - extension StrongTableModel { func headerHeight(for section: Int) -> CGFloat { guard let title = header(forSection: section) else { diff --git a/Passepartout-iOS/Global/Theme.swift b/Passepartout-iOS/Global/Theme.swift index 16f84761..46db848a 100644 --- a/Passepartout-iOS/Global/Theme.swift +++ b/Passepartout-iOS/Global/Theme.swift @@ -82,16 +82,10 @@ struct Theme { var palette: Palette - var masterTitleDisplayMode: UINavigationItem.LargeTitleDisplayMode - - var detailTitleDisplayMode: UINavigationItem.LargeTitleDisplayMode - var modalPresentationStyle: UIModalPresentationStyle private init() { palette = Palette() - masterTitleDisplayMode = .never - detailTitleDisplayMode = .never modalPresentationStyle = .formSheet } } @@ -116,6 +110,12 @@ extension Theme { } } +extension UIViewController { + func applyModalPresentation(_ theme: Theme) { + modalPresentationStyle = theme.modalPresentationStyle + } +} + extension UIView { func applyPrimaryBackground(_ theme: Theme) { backgroundColor = theme.palette.primaryBackground diff --git a/Passepartout-iOS/Scenes/About/AboutViewController.swift b/Passepartout-iOS/Scenes/About/AboutViewController.swift index 1dcfefe1..16ad798f 100644 --- a/Passepartout-iOS/Scenes/About/AboutViewController.swift +++ b/Passepartout-iOS/Scenes/About/AboutViewController.swift @@ -53,12 +53,6 @@ class AboutViewController: UITableViewController, StrongTableHost { // MARK: UIViewController - override func awakeFromNib() { - super.awakeFromNib() - - applyDetailTitle(.current) - } - override func viewDidLoad() { super.viewDidLoad() diff --git a/Passepartout-iOS/Scenes/About/LabelViewController.swift b/Passepartout-iOS/Scenes/About/LabelViewController.swift index ae85913f..8de33ce7 100644 --- a/Passepartout-iOS/Scenes/About/LabelViewController.swift +++ b/Passepartout-iOS/Scenes/About/LabelViewController.swift @@ -37,12 +37,6 @@ class LabelViewController: UIViewController { var license: AppConstants.License? - override func awakeFromNib() { - super.awakeFromNib() - - applyDetailTitle(.current) - } - override func viewDidLoad() { super.viewDidLoad() diff --git a/Passepartout-iOS/Scenes/AccountViewController.swift b/Passepartout-iOS/Scenes/AccountViewController.swift index 5896159e..e61f4237 100644 --- a/Passepartout-iOS/Scenes/AccountViewController.swift +++ b/Passepartout-iOS/Scenes/AccountViewController.swift @@ -134,12 +134,6 @@ class AccountViewController: UIViewController, StrongTableHost { // MARK: UIViewController - override func awakeFromNib() { - super.awakeFromNib() - - applyDetailTitle(.current) - } - override func viewDidLoad() { super.viewDidLoad() diff --git a/Passepartout-iOS/Scenes/ConfigurationViewController.swift b/Passepartout-iOS/Scenes/ConfigurationViewController.swift index c8fb793c..b0124fd2 100644 --- a/Passepartout-iOS/Scenes/ConfigurationViewController.swift +++ b/Passepartout-iOS/Scenes/ConfigurationViewController.swift @@ -90,12 +90,6 @@ class ConfigurationViewController: UIViewController, StrongTableHost { // MARK: UIViewController - override func awakeFromNib() { - super.awakeFromNib() - - applyDetailTitle(.current) - } - override func viewDidLoad() { super.viewDidLoad() diff --git a/Passepartout-iOS/Scenes/DebugLogViewController.swift b/Passepartout-iOS/Scenes/DebugLogViewController.swift index c1859b2a..2a29f032 100644 --- a/Passepartout-iOS/Scenes/DebugLogViewController.swift +++ b/Passepartout-iOS/Scenes/DebugLogViewController.swift @@ -38,12 +38,6 @@ class DebugLogViewController: UIViewController { NotificationCenter.default.removeObserver(self) } - override func awakeFromNib() { - super.awakeFromNib() - - applyDetailTitle(.current) - } - // MARK: UIViewController override func viewDidLoad() { diff --git a/Passepartout-iOS/Scenes/EndpointViewController.swift b/Passepartout-iOS/Scenes/EndpointViewController.swift index 9f2d1a9a..ff8bd879 100644 --- a/Passepartout-iOS/Scenes/EndpointViewController.swift +++ b/Passepartout-iOS/Scenes/EndpointViewController.swift @@ -91,12 +91,6 @@ class EndpointViewController: UIViewController, StrongTableHost { // MARK: UIViewController - override func awakeFromNib() { - super.awakeFromNib() - - applyDetailTitle(.current) - } - override func viewDidLoad() { super.viewDidLoad() diff --git a/Passepartout-iOS/Scenes/Organizer/OrganizerViewController.swift b/Passepartout-iOS/Scenes/Organizer/OrganizerViewController.swift index 9b57058c..9de6ff0e 100644 --- a/Passepartout-iOS/Scenes/Organizer/OrganizerViewController.swift +++ b/Passepartout-iOS/Scenes/Organizer/OrganizerViewController.swift @@ -104,12 +104,6 @@ class OrganizerViewController: UITableViewController, StrongTableHost { NotificationCenter.default.removeObserver(self) } - override func awakeFromNib() { - super.awakeFromNib() - - applyMasterTitle(.current) - } - override func viewDidLoad() { super.viewDidLoad() diff --git a/Passepartout-iOS/Scenes/ProviderPoolViewController.swift b/Passepartout-iOS/Scenes/ProviderPoolViewController.swift index 82c24922..4efddfc1 100644 --- a/Passepartout-iOS/Scenes/ProviderPoolViewController.swift +++ b/Passepartout-iOS/Scenes/ProviderPoolViewController.swift @@ -64,12 +64,6 @@ class ProviderPoolViewController: UIViewController { // MARK: UIViewController - override func awakeFromNib() { - super.awakeFromNib() - - applyDetailTitle(.current) - } - override func viewDidLoad() { super.viewDidLoad() diff --git a/Passepartout-iOS/Scenes/ProviderPresetViewController.swift b/Passepartout-iOS/Scenes/ProviderPresetViewController.swift index f87f4fd9..6bd2fc5a 100644 --- a/Passepartout-iOS/Scenes/ProviderPresetViewController.swift +++ b/Passepartout-iOS/Scenes/ProviderPresetViewController.swift @@ -45,12 +45,6 @@ class ProviderPresetViewController: UIViewController { // MARK: UIViewController - override func awakeFromNib() { - super.awakeFromNib() - - applyDetailTitle(.current) - } - override func viewDidLoad() { super.viewDidLoad() diff --git a/Passepartout-iOS/Scenes/ServerNetworkViewController.swift b/Passepartout-iOS/Scenes/ServerNetworkViewController.swift index b7cb8b50..fdf561db 100644 --- a/Passepartout-iOS/Scenes/ServerNetworkViewController.swift +++ b/Passepartout-iOS/Scenes/ServerNetworkViewController.swift @@ -113,12 +113,6 @@ class ServerNetworkViewController: UITableViewController, StrongTableHost { // MARK: UIViewController - override func awakeFromNib() { - super.awakeFromNib() - - applyDetailTitle(.current) - } - override func viewDidLoad() { super.viewDidLoad() diff --git a/Passepartout-iOS/Scenes/ServiceViewController.swift b/Passepartout-iOS/Scenes/ServiceViewController.swift index 5b11bdfa..0456eb87 100644 --- a/Passepartout-iOS/Scenes/ServiceViewController.swift +++ b/Passepartout-iOS/Scenes/ServiceViewController.swift @@ -87,12 +87,6 @@ class ServiceViewController: UIViewController, StrongTableHost { } } - override func awakeFromNib() { - super.awakeFromNib() - - applyDetailTitle(.current) - } - override func viewDidLoad() { super.viewDidLoad() diff --git a/Passepartout-iOS/Scenes/Shortcuts/ShortcutsViewController.swift b/Passepartout-iOS/Scenes/Shortcuts/ShortcutsViewController.swift index 7bd98717..52accb15 100644 --- a/Passepartout-iOS/Scenes/Shortcuts/ShortcutsViewController.swift +++ b/Passepartout-iOS/Scenes/Shortcuts/ShortcutsViewController.swift @@ -146,7 +146,7 @@ class ShortcutsViewController: UITableViewController, INUIAddVoiceShortcutViewCo } pendingShortcut = nil let vc = INUIAddVoiceShortcutViewController(shortcut: shortcut) - vc.modalPresentationStyle = Theme.current.modalPresentationStyle + vc.applyModalPresentation(.current) vc.delegate = self present(vc, animated: true, completion: nil) } @@ -206,7 +206,7 @@ class ShortcutsViewController: UITableViewController, INUIAddVoiceShortcutViewCo break } let vc = INUIEditVoiceShortcutViewController(voiceShortcut: wrapper.original) - vc.modalPresentationStyle = Theme.current.modalPresentationStyle + vc.applyModalPresentation(.current) vc.delegate = self editedIndexPath = indexPath present(vc, animated: true, completion: nil)