NavigationStack and NavigationSplitView Runtime warnings

Overview:

When running the demo code presented in "The SwiftUI cookbook for navigation" (https://developer.apple.com/wwdc22/10054) I ran into some issues:

Runtime warnings:

2022-06-08 22:20:31.587169+0800 NavigationSplitViewDemo[17797:672165] [SwiftUI] A NavigationLink is presenting a value of type “Category” but there is no matching navigation destination visible from the location of the link. The link cannot be activated.
onChange(of: UpdateTrigger) action tried to update multiple times per frame.
2022-06-08 22:15:23.432289+0800 NavigationSplitViewDemo[17645:662571] [UIFocus] _TtGC7SwiftUI14_UIHostingViewGVS_15ModifiedContentVS_7AnyViewVS_12RootModifier__ implements focusItemsInRect: - caching for linear focus movement is limited as long as this view is on screen.

Feedback filed:

FB10103041 and FB10104196

Accepted Reply

Based on the Apple Engineer's response this is a bug, I have also filed feedback and mentioned it.

Replies

Based on the Apple Engineer's response this is a bug, I have also filed feedback and mentioned it.

I had same error but in my own code and I wrote another feedback ticket for that: FB10260549 with my own sample project to reproduce it. I didn't look at the demo code but in my case its when you have a NavigationLink(value:) in a List with valid .navigationDestination modifier code but that is inside a destination view of a parent List with NavigationLinks that use the old style without values.

  • Thank @antarian, I was scratching my head on this one and indeed am experiencing the same behaviour

  • Can confirm this! Changing all Views in the stack to NavigationLinks with value fixes this issue.

Add a Comment

Confusion about NavigationSplitView

There seem to be 2 ways:

Not sure what is the correct approach, using NavigationLink seems to require navigationDestination but that doesn't sit well with NavigationSplitView as the destination view is specified part of the detail closure and repeating the code would be redundant.

Following the documentation (without NavigationLink):

Update NavigationAuthority bound selection tried to update multiple times per frame.
  • The other 2 warnings about navigationDestination and Focus are not thrown

I really wish someone from the Apple team could clarify on this, please.

Me too, Xcode 14 beta

2022-07-09 15:59:03.015247+0800 BarB[30014:522659] [UIFocus] UIPickerTableView implements focusItemsInRect: - caching for linear focus movement is limited as long as this view is on screen.

2022-07-09 15:59:03.015440+0800 BarB[30014:522659] [UIFocus] UIPickerTableView implements focusItemsInRect: - caching for linear focus movement is limited as long as this view is on screen.