Skip Navigation

Is it expected behavior that reading an empty NavigationPath back into memory from UserDefaults and then using that path for navigation breaks the app? Nothing renders on the screen, even though my Vi

Is it expected behavior that reading an empty NavigationPath back into memory from UserDefaults and then using that path for navigation breaks the app? Nothing renders on the screen, even though my View that should render has its onAppear trigger, and there’s no errors. If the loaded path isn’t empty, it works as expected.

I’ve gotten around this issue by checking if the loaded path is empty, and creating a new one if so. This doesn’t seem right, though.

I was following along with Apple’s tutorial pretty closely. The only other thing I really changed was the .onChange of scenePhase, because it wasn’t triggering as they wrote it. I instead observed the path for changes.

#SwiftUI

0
0 comments