Create modal presentation theme
This commit is contained in:
parent
39ff0e3093
commit
bacd510345
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -110,6 +110,12 @@ extension Theme {
|
|||
}
|
||||
}
|
||||
|
||||
extension UIViewController {
|
||||
func applyModalPresentation(_ theme: Theme) {
|
||||
modalPresentationStyle = theme.modalPresentationStyle
|
||||
}
|
||||
}
|
||||
|
||||
extension UIView {
|
||||
func applyPrimaryBackground(_ theme: Theme) {
|
||||
backgroundColor = theme.palette.primaryBackground
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue