Post

Replies

Boosts

Views

Activity

Reply to iOS: List selection is reset to nil when app is sent to background
I "fix" this by the save the selection to a temp variable onChange of the @Environment(.scenePhase) .onChange(of: scenePhase) { phase in             if phase == .background{                 tempSelectedId = selectedId             } else {                 if phase == .inactive && selectedId == nil{                     selectedId = tempSelectedId                     print("Restore - scenePhase")                 }             }         }
Feb ’23