Post

Replies

Boosts

Views

Activity

Reply to Back button is not visible when navigating from a view with no toolbar to a view with a toolbar button on macOS 15.4 beta
Unfortunately, same issue happens today after updating to macOS 15.4 (24E248). I also had no luck to fix the native BackButton. So, replacing the native BackButton into a custom one with same design in all views was the simplest quick decision. Add MacOSBackButtonView into your project. struct MacOSBackButtonView: View { @Environment(\.dismiss) private var dismiss var body: some View { VStack {} #if os(macOS) .navigationBarBackButtonHidden() .toolbar { ToolbarItem(placement: .navigation) { Button(action: { dismiss() }) { Image(systemName: "chevron.backward") } } } #endif } } Add MacOSBackButtonView() into VStack (or any other place in body) of all views that must have BackButton on macOS. struct YourView: View { var body: some View { VStack { MacOSBackButtonView() ... } } } Now, You can forget about the issue.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’25