NavigationBackport
NavigationBackport copied to clipboard
Could you support NavigationSplitView ?
Hi, I want to use your library but my app support iPhone and iPad so I need to depend on NavigationSplitView not NavigationStack
Could you support it ?
Hi @X901, thanks for raising this. I've opened a PR #28 with support for NBNavigationSplitView, albeit with limitations. If you have a chance to check out the branch and try it out, I'd be grateful for any feedback. Thanks!
Hi, I was on vacation, I will try it tomorrow, and give you feedback 👏
Thanks for checking it out @X901 ! The example code you referenced is a little strange, as it sets up a selection property, but doesn't actually use it to show the detail; instead it uses NavigationLink. If you change the sidebarContent to:
List([DemoScreen.first, .second, .third], id: \.self, selection: $selection) { page in
Text(page.title)
}
then it will work as expected (for both NavigationSplitView and NBNavigationSplitView) using the selection property rather than a NavigationLink.
Whilst NavigationLinks can be embedded in the sidebar of a NavigationSplitView, this isn't supported in NBNavigationSplitView. They can only be embedded in a NBNavigationStack in the detail pane. It might be possible to support that in the future.
Thanks for raising this, as I realise this ought to be documented better.
Adding a +1 to using NBNavigationLink in the sidebar somehow. I currently don't use a selection property for my navigation but, instead, use NavigationLink with the older NavigationView with a 2-column set up. I'd love to use this for programmatic navigation with iOS 14 support if possible.
Hi, Your library works well for us and we would love to also use a back port of the NavigationSplitView. The issue is quite old so I was wondering if you still had support for this in mind ?
Thank you for your great work 🙏
I played with the idea of recreating NavigationSplitView using NavigationView but there are a lot of subtle ways NavigationSplitView can be used, and I don't think its full functionality can be recreated acceptably well, so I'm afraid it will remain out of the scope of this library.
Thank you for checking anyways, @johnpatrickmorgan. Given the age of the navigation APIs, I know I personally was ready to move to support iOS 16+. Hopefully others affected here will be able to do the same soon, too.