Fix iPad multitasking condition

This commit is contained in:
Davide De Rosa 2022-05-19 20:11:08 +02:00
parent fe4ca51820
commit d6866e8e95
2 changed files with 13 additions and 12 deletions

View File

@ -31,14 +31,6 @@ extension View {
UIDevice.current.userInterfaceIdiom
}
var themeIsiPad: Bool {
#if targetEnvironment(macCatalyst)
false
#else
UIDevice.current.userInterfaceIdiom == .pad
#endif
}
var themeIsiPadPortrait: Bool {
#if targetEnvironment(macCatalyst)
false
@ -48,8 +40,15 @@ extension View {
#endif
}
var themeIsMultitasking: Bool {
UIDevice.current.isMultitaskingSupported
var themeIsiPadMultitasking: Bool {
#if targetEnvironment(macCatalyst)
false
#else
guard #available(iOS 15, *) else {
return false
}
return UIDevice.current.userInterfaceIdiom == .pad
#endif
}
}

View File

@ -52,8 +52,10 @@ extension OrganizerView {
List {
if profileManager.hasProfiles {
// FIXME: iPad multitasking, navigation binding does not clear on pop without Section
if themeIsiPad && themeIsMultitasking {
// FIXME: iPad multitasking, navigation binding does not clear on pop
// - if listStyle is different than .sidebar
// - if listStyle is .sidebar but List has no Section
if themeIsiPadMultitasking {
Section {
profilesView
} header: {