Post

Replies

Boosts

Views

Activity

Xcode 16 NavigationStack using environment variable
Hello, My app worked perfectly using Xcode 15.4. After updating to Xcode 16, my NavigationStack started to present the same screen twice using the following code: @EnvironmentObject private var pathSports: NavigationRouteManager var body: some View { NavigationStack(path: $pathSports.path) { .... } .environmentObject(pathSports) } NavigationRouteManager: import Foundation import SwiftUI class NavigationRouteManager: ObservableObject { @Published var path = NavigationPath() func jumpToRootView() { path = NavigationPath() } } I have had to change it to the following code for just a single screen to be displayed. @State private var pathSports: NavigationPath = NavigationPath() var body: some View { NavigationStack(path: $pathSports) { .... } } Have others experienced this same problem, or is it just me? Many thanks.
2
0
184
Oct ’24