ios: Testing workaround of a crash

This commit is contained in:
Avently
2023-01-17 18:13:33 +03:00
parent 19881703e5
commit a2ccff97fe
2 changed files with 14 additions and 1 deletions

View File

@@ -17,7 +17,7 @@ struct ChatListView: View {
@State private var showAddChat = false
var body: some View {
NavigationView {
NavStackWorkaround {
VStack {
if chatModel.chats.isEmpty {
onboardingButtons()

View File

@@ -64,3 +64,16 @@ extension View {
modifier(SheetForItem(item: item, onDismiss: onDismiss, sheetContent: content))
}
}
struct NavStackWorkaround<T: View>: View {
let content: ()->T
var body: some View {
if #available(iOS 16, *) {
NavigationStack(root: content)
} else {
NavigationView(content: content)
.navigationViewStyle(.stack)
}
}
}