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.parsingResult = parsingResult
|
||||||
wizard.removesConfigurationOnCancel = true
|
wizard.removesConfigurationOnCancel = true
|
||||||
|
|
||||||
wizardNav.modalPresentationStyle = .formSheet
|
wizardNav.applyModalPresentation(.current)
|
||||||
target.present(wizardNav, animated: true, completion: nil)
|
target.present(wizardNav, animated: true, completion: nil)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,6 +110,12 @@ extension Theme {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension UIViewController {
|
||||||
|
func applyModalPresentation(_ theme: Theme) {
|
||||||
|
modalPresentationStyle = theme.modalPresentationStyle
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
extension UIView {
|
extension UIView {
|
||||||
func applyPrimaryBackground(_ theme: Theme) {
|
func applyPrimaryBackground(_ theme: Theme) {
|
||||||
backgroundColor = theme.palette.primaryBackground
|
backgroundColor = theme.palette.primaryBackground
|
||||||
|
|
|
@ -146,7 +146,7 @@ class ShortcutsViewController: UITableViewController, INUIAddVoiceShortcutViewCo
|
||||||
}
|
}
|
||||||
pendingShortcut = nil
|
pendingShortcut = nil
|
||||||
let vc = INUIAddVoiceShortcutViewController(shortcut: shortcut)
|
let vc = INUIAddVoiceShortcutViewController(shortcut: shortcut)
|
||||||
vc.modalPresentationStyle = Theme.current.modalPresentationStyle
|
vc.applyModalPresentation(.current)
|
||||||
vc.delegate = self
|
vc.delegate = self
|
||||||
present(vc, animated: true, completion: nil)
|
present(vc, animated: true, completion: nil)
|
||||||
}
|
}
|
||||||
|
@ -206,7 +206,7 @@ class ShortcutsViewController: UITableViewController, INUIAddVoiceShortcutViewCo
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
let vc = INUIEditVoiceShortcutViewController(voiceShortcut: wrapper.original)
|
let vc = INUIEditVoiceShortcutViewController(voiceShortcut: wrapper.original)
|
||||||
vc.modalPresentationStyle = Theme.current.modalPresentationStyle
|
vc.applyModalPresentation(.current)
|
||||||
vc.delegate = self
|
vc.delegate = self
|
||||||
editedIndexPath = indexPath
|
editedIndexPath = indexPath
|
||||||
present(vc, animated: true, completion: nil)
|
present(vc, animated: true, completion: nil)
|
||||||
|
|
Loading…
Reference in New Issue