Embedding a NavigationSplitView inside a NavigationStack

Embedding a NavigationStack inside the detail view of a NavigationSplitView is described by the Apple documentation: https://developer.apple.com/documentation/swiftui/navigationsplitview

However, I would like to do the opposite: embedding a NavigationSplitView inside a NavigationStack. I have found no hint in the documentation about why this shouldn't be possible, but it does not appear to be working consistently.

There are many use cases where you might want to do this. E.g. you have an eBook reader that starts with a list of books (e.g. a Grid inside a NavigationStack), and when you open a book, you end up in a NavigationSplitView showing the chapter hierarchy in a sidebar. Here, you wouldn't want to have the list of books as a second sidebar, but would want an option to go back to the list of books at any time.

The following trivial example correctly displays a NavigationSplitView on iPadOS, but results in an empty view on iOS:

NavigationStack {
  NavigationSplitView {
    List {
      Text("Element1")
      Text("Element2")
    }
  } detail: {
    Text("Detail")
  }
}

Is there a workaround?

NavigationSplitView and TabView are top level navigation containers and could have unexpected behaviors when they're not implemented as such. on iOS, a NavigationSplitView collapses all of its columns into a stack.So it's best practice to prefer using a split view in a regular — not a compact — environments.

Please file an enhancement request using Feedback Assistant. Once you file the request, please post the FB number here.

If you're not familiar with how to file enhancement requests, take a look at Bug Reporting: How and Why?

Thank you for response, I've reported this under the ticket number FB16448657

Embedding a NavigationSplitView inside a NavigationStack
 
 
Q