passepartoutvpn / passepartout-app

VPN client for Apple platforms.
https://passepartoutvpn.app
GNU General Public License v3.0
772 stars 119 forks source link

iOS 16: Refactor NavigationLink #415

Open keeshux opened 6 months ago

keeshux commented 6 months ago

'init(_:isActive:destination:)' was deprecated in iOS 16.0: use NavigationLink(_:value:) inside a NavigationStack or NavigationSplitView

Create a custom component for conditional reuse on iOS 15 / 16.

From:

https://developer.apple.com/documentation/swiftui/view/navigationdestination(for:destination:)

Do not put a navigation destination modifier inside a “lazy” container, like List or LazyVStack. These containers create child views only when needed to render on screen. Add the navigation destination modifier outside these containers so that the navigation stack can always see the destination.

https://www.avanderlee.com/swiftui/navigationlink-programmatically-binding/


Probably related issue:

Test by stripping down Organizer+Profiles content.

See if navigation link destinations are being redrawn (iOS 16 documentation about .navigationDestination).

Try also with iCloud disabled.


Using iOS 16 API with #available “resolves” the issue, but a lot of stuttering while scrolling sidebar.

Either navigation, iOS 15 or 16, generates plenty of these messages when scrolling sidebar:

2023-07-10 23:06:26.163014+0100 Passepartout[10693:8388608] [API] cannot add handler to 3 from 3 - dropping