forked from shadowfacts/Tusker
Disable non-stack navigation on Max iPhones
This commit is contained in:
parent
1f9806d02f
commit
405d5def7c
|
@ -66,14 +66,20 @@ class MainSplitViewController: UISplitViewController {
|
||||||
}
|
}
|
||||||
|
|
||||||
let nav: UIViewController
|
let nav: UIViewController
|
||||||
navigationMode = Preferences.shared.widescreenNavigationMode
|
let visionIdiom = UIUserInterfaceIdiom(rawValue: 6)
|
||||||
switch navigationMode! {
|
if [visionIdiom, .pad, .mac].contains(UIDevice.current.userInterfaceIdiom) {
|
||||||
case .stack:
|
navigationMode = Preferences.shared.widescreenNavigationMode
|
||||||
|
switch navigationMode! {
|
||||||
|
case .stack:
|
||||||
|
nav = EnhancedNavigationViewController()
|
||||||
|
case .splitScreen:
|
||||||
|
nav = SplitNavigationController()
|
||||||
|
case .multiColumn:
|
||||||
|
nav = MultiColumnNavigationController()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
navigationMode = .stack
|
||||||
nav = EnhancedNavigationViewController()
|
nav = EnhancedNavigationViewController()
|
||||||
case .splitScreen:
|
|
||||||
nav = SplitNavigationController()
|
|
||||||
case .multiColumn:
|
|
||||||
nav = MultiColumnNavigationController()
|
|
||||||
}
|
}
|
||||||
setViewController(nav, for: .secondary)
|
setViewController(nav, for: .secondary)
|
||||||
|
|
||||||
|
@ -115,7 +121,9 @@ class MainSplitViewController: UISplitViewController {
|
||||||
}
|
}
|
||||||
|
|
||||||
private func updateNavigationMode(_ mode: WidescreenNavigationMode) {
|
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
|
return
|
||||||
}
|
}
|
||||||
navigationMode = mode
|
navigationMode = mode
|
||||||
|
|
Loading…
Reference in New Issue