Hello,
In our current project we are using NavigationSplitView in the following way:
var body: some View {
NavigationSplitView(
sidebar: {
ListView()
},
detail: {
DetailsView()
}
)
.navigationBarHidden(true)
.navigationSplitViewStyle(.automatic)
.introspectSplitViewController { splitViewController in
splitViewController.preferredDisplayMode = .oneOverSecondary
splitViewController.maximumPrimaryColumnWidth = 500
splitViewController.preferredPrimaryColumnWidthFraction = 1
}
}
}
And in iPhone the DetailsView() is pushed using the navigationDestination modifier:
.navigationDestination(isPresented: $isShowingDetailsScreen) {
DetailsView()
.navigationBarHidden(true)
}
where isShowingDetailsScreen is updated through a button click:
Button() {
self.isShowingDetailsScreen = true
}
This works perfectly in iOS versions prior to 18. However starting from this version the button click no longer presents the view desired. Below is what happening in the latest iOS versions:
- iOS 18: This mechanism is broken altogether, it does not work at all.
- iOS 18.1: This mechanism is partially broken, when clicking on the button the DetailsView is not presented, however since the page also contains other reactive views, any time one of them is changed through a state change after clicking on that button, the DetailsView is presented.
Does anyone faced an issue like this with the new iOS and if so is there any workaround for now? Because this seems to be a bug caused by changes in SwiftUI and shouldn't persist for long.