My iOS (iPhone/iPad/Mac Catalyst) app has a relatively complex authentication flow, primarily required due to it being an API client. Several of my views have .task
modifiers that begin executing code when the views are created.
After moving to iOS 18 and Xcode 16, when running in the Simulator, I began noticing my workflow was breaking as views were being created out of sequence... but not by me 🤯
Here is an example stack when I place a breakpoint inside of this view's .task
.
- From my logging (and this stack) I can verify I am not creating this view.
- This view has no preview associated with it, and there are no previews up the view hierarchy from it either.
- This happens in the Simulator only
The only clue I have to go on is this line of text which is present at the top of what looks like ASM when I click on the (5) line in the stack above.
SwiftUI`(1) await resume partial function for dispatch thunk of static SwiftUI.PreviewModifier.makeSharedContext() async throws -> τ_0_0.Context:
If this (or any hierarchical view) used Previews, I'd remove them to see if it had an effect, but they don't! I'm at a loss on what to do here...