Post

Replies

Boosts

Views

Activity

Reply to SwiftUI BottomBar Toolbar on parent view breaks leading navigation swipe on iOS 17.0
Hello! Issue seems to still be relevant, and I found a quick workaround for this bug, have not yet seen any downsides. Since bug is not present while bottom toolbar is empty, you can make it seem empty while View is not presented using .onAppear and .onDisappear modifiers: struct ToolbarIssueView: View { @State private var showBottomBar: Bool = false //add state var body: some View { NavigationStack { NavigationLink { Text("Detail View") .navigationTitle("Detail") } label: { Text("To Detail View") } .onAppear { showBottomBar = true } //add onAppear .onDisappear { showBottomBar = false } //add onDisappear .toolbar { // This seems to cause strange behavior ToolbarItem(placement: .bottomBar) { if showBottomBar { //wrap .bottomBar content with this "if" Text("Bottom Bar Content") } } } .navigationTitle("Main") } } }
Jan ’24