iOS 17 Beta 4 - SwiftUI @State properties reset when app enters the background


From my understanding it is common practice to use @State properties for views such as a boolean used to determine whether or not a view is being shown or a DisclosureGroup is expanded.

On iOS 17 Beta 4, I've noticed that when the app enters the background, these properties are reset. This results in views being close, changed values being reset, etc. This does not happen on iOS 16.4/16.5 and below.

Is anyone else experiencing this? Should we expect that this is the normal SwiftUI behavior for iOS 17 and prepare for it?

Same issue carried over to iOS 17 Beta 5.

Same issue carried over to iOS 17 Beta 6 :(

Same issue carried over to iOS 17 Beta 7

I haven't seen this. Can you post a small code sample that demonstrates the problem?

After the app exits to the background and then opens it, it will automatically return to the navigation home page every time it exits to the background page

I think it is still there in iOS 17.0.3. Is it fixed for anyone or are there any workarounds?

iOS 17 Beta 4 - SwiftUI @State properties reset when app enters the background

 
 
Q