how to save the state when I open another APP ?

how to save the state of my APP when I open another APP so that It can restore when I re-open it?

my app will use over 10mb memory so if I open another APP(my app will go background) it will closed at all.

when I re-open it it will restart.

but I do not want it I want if I open Page A and then it go background and when I re-open it it still is Page A and do not restart.

@xieyue Restoring Your App’s State with SwiftUI sample project covers this and should help you get started.

how to save the state when I open another APP ?
 
 
Q