forked from shadowfacts/Tusker
Disable non-stack navigation on Max iPhones
This commit is contained in:
parent
1f9806d02f
commit
405d5def7c
|
@ -66,6 +66,8 @@ class MainSplitViewController: UISplitViewController {
|
|||
}
|
||||
|
||||
let nav: UIViewController
|
||||
let visionIdiom = UIUserInterfaceIdiom(rawValue: 6)
|
||||
if [visionIdiom, .pad, .mac].contains(UIDevice.current.userInterfaceIdiom) {
|
||||
navigationMode = Preferences.shared.widescreenNavigationMode
|
||||
switch navigationMode! {
|
||||
case .stack:
|
||||
|
@ -75,6 +77,10 @@ class MainSplitViewController: UISplitViewController {
|
|||
case .multiColumn:
|
||||
nav = MultiColumnNavigationController()
|
||||
}
|
||||
} else {
|
||||
navigationMode = .stack
|
||||
nav = EnhancedNavigationViewController()
|
||||
}
|
||||
setViewController(nav, for: .secondary)
|
||||
|
||||
// don't unnecesarily construct a content VC unless the we're in actually split mode
|
||||
|
@ -115,7 +121,9 @@ class MainSplitViewController: UISplitViewController {
|
|||
}
|
||||
|
||||
private func updateNavigationMode(_ mode: WidescreenNavigationMode) {
|
||||
guard mode != navigationMode else {
|
||||
let visionIdiom = UIUserInterfaceIdiom(rawValue: 6)
|
||||
guard [visionIdiom, .pad, .mac].contains(UIDevice.current.userInterfaceIdiom),
|
||||
mode != navigationMode else {
|
||||
return
|
||||
}
|
||||
navigationMode = mode
|
||||
|
|
Loading…
Reference in New Issue