Where are you putting this code? Are you writing an extension into View?
Post
Replies
Boosts
Views
Activity
Yes but this did not fix the problem 100% it seems to be worse on iOS 16 and better in iOS 16.2.
I found a solution for this. I replaced all my NavigationViews with NavigationStacks.
I have the exact same issue.
The last lines of the log are always the same
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 SwiftUI 0x1b8f98208 0x1b8781000 + 8483336
1 SwiftUI 0x1b8f981c8 0x1b8781000 + 8483272
2 SwiftUI 0x1b8f98220 0x1b8781000 + 8483360
3 SwiftUI 0x1b99ddbc4 0x1b8781000 + 19254212
4 SwiftUI 0x1b87e9244 0x1b8781000 + 426564
5 SwiftUI 0x1b87c8dd0 0x1b8781000 + 294352
6 UIKitCore 0x1b7171c84 -[UIViewController removeChildViewController:notifyDidMove:] + 128
7 UIKitCore 0x1b7735f7c -[UINavigationController removeChildViewController:notifyDidMove:] + 80
8 UIKitCore 0x1b71bfa10 -[UIViewController dealloc]