Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could you support NavigationSplitView ? #27

Open
X901 opened this issue Nov 15, 2022 · 6 comments
Open

Could you support NavigationSplitView ? #27

X901 opened this issue Nov 15, 2022 · 6 comments

Comments

@X901
Copy link

X901 commented Nov 15, 2022

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 ?

@johnpatrickmorgan
Copy link
Owner

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!

@X901
Copy link
Author

X901 commented Jan 4, 2023

Hi,
I was on vacation, I will try it tomorrow, and give you feedback 👏

@X901
Copy link
Author

X901 commented Jan 5, 2023

I was trying this example

Screenshot 2023-01-05 at 10 45 10 AM

but I got this error on iPhone and iPad

Screenshot 2023-01-05 at 10 46 22 AM

@johnpatrickmorgan
Copy link
Owner

johnpatrickmorgan commented Jan 5, 2023

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.

@JoshHrach
Copy link

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.

@PhilippeWeidmann
Copy link

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 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants