NavigationSplitView issues in iOS 18 and 18.1

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.

@maazarou Could you please provide a small test project that reproduces the issue so that I could investigate it. If you're not familiar with preparing a test project, take a look at Creating a test project.

@DTS Engineer Hello, I've created a test project that reproduces the issue in github. Note that the issue is not actually reproducible with only what I've described initially, it seems that it comes from the fact that we are using NavigationSplitView inside a NavigationStack.

I hope the project will make it clear.

NavigationSplitView issues in iOS 18 and 18.1
 
 
Q