Group Group Group Group Group Group Group Group Group

Chapter 4 - Tapping `Play BullsEye` is not working more than once

Issue is also in the RGBullsEye of the final folder of 04-integrating-swiftui.

  • TappingPlay BullsEye navigates to the view of Bulls Eye
  • Play once and then tap Back which navigates back to the RGBullsEye
  • Tapping Play BullsEye now, is not navigating to Bulls Eye

hi Pat! thanks! this seems to be a general problem with NavigationLink in Simulator/Live Preview. See https://forums.developer.apple.com/thread/124757 and https://forums.developer.apple.com/thread/125937

It’s not worth using the klutzy fix because the bug doesn’t appear on a device.

1 Like

Thanks. Sorry that I did not look further.

I’ve just now run it on my XR, and it doesn’t behave well in split view navigation style. Either check the Portrait Device Orientation for the Target, or add .navigationViewStyle(StackNavigationViewStyle()) after navigationBarTitle(_:) in ContentVIew.swift, to force it to use “normal” navigation. Then you can tap the Play BullsEye button again and again, and get a different random target value each time :grinning:

It’s annoying to have the simulator out of sync with the device. We’re hoping Apple fixes NavigationLink soon.