mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Display Settings sheet on iOS 15 and above
This commit is contained in:
parent
badf80ef5c
commit
28856eb434
@ -35,7 +35,22 @@ struct ContentView: View {
|
|||||||
.help("Create a new local draft.")
|
.help("Create a new local draft.")
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
CollectionListView()
|
if #available(iOS 15.0, *) {
|
||||||
|
CollectionListView()
|
||||||
|
.alert(isPresented: $model.isPresentingNetworkErrorAlert, content: {
|
||||||
|
Alert(
|
||||||
|
title: Text("Connection Error"),
|
||||||
|
message: Text("""
|
||||||
|
There is no internet connection at the moment. Please reconnect or try again later.
|
||||||
|
"""),
|
||||||
|
dismissButton: .default(Text("OK"), action: {
|
||||||
|
model.isPresentingNetworkErrorAlert = false
|
||||||
|
})
|
||||||
|
)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
CollectionListView()
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
@ -49,15 +64,29 @@ struct ContentView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
PostListView()
|
if #available(iOS 15.0, *) {
|
||||||
|
PostListView()
|
||||||
|
.sheet(
|
||||||
|
isPresented: $model.isPresentingSettingsView,
|
||||||
|
onDismiss: { model.isPresentingSettingsView = false },
|
||||||
|
content: {
|
||||||
|
SettingsView()
|
||||||
|
.environmentObject(model)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
PostListView()
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Text("Select a post, or create a new local draft.")
|
Text("Select a post, or create a new local draft.")
|
||||||
.foregroundColor(.secondary)
|
.foregroundColor(.secondary)
|
||||||
}
|
}
|
||||||
.environmentObject(model)
|
.environmentObject(model)
|
||||||
|
// For iOS 14
|
||||||
#if os(iOS)
|
if #available(iOS 15.0, *) {
|
||||||
|
// Do nothing.
|
||||||
|
} else {
|
||||||
EmptyView()
|
EmptyView()
|
||||||
.sheet(
|
.sheet(
|
||||||
isPresented: $model.isPresentingSettingsView,
|
isPresented: $model.isPresentingSettingsView,
|
||||||
@ -78,7 +107,7 @@ struct ContentView: View {
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
#endif
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user