I would like to ask some suggestion about how to restore a viewControllers state. Like in the app called "Pic Collage" when you create a card and save it and later restore it.
What is the best way to restore the state of ViewController
2.8k views Asked by Anand At
2
There are 2 answers
1
On
If you are supporting iOS 6 and above, take a look at State Preservation and Restoration. Even if you have to support older versions of iOS the documentation will guide you on when and how restoration can be achieved and the things you need to consider.
If you really want to learn about state preservation, see WWDC 2012 video, Saving and Restoring Application State on iOS.
But, it's also just as likely that the app in question is simply saving the model data (the object model that represents this card) in persistent storage, and when the app re-starts, it simply loads that model data again. There are a whole bunch of possible technologies for persistent storage ranging from Core Data (robust, but a little complicated) to plists (simple, but less sophisticated). There are tons other options (archives and serialization, SQLite, JSON, etc.), but I'd rather not cloud the issue further.
I'd suggest you familiarize yourself with some of these technologies, work through a few demonstrations, and come back if you have additional questions. But this question is too broad to get into specific answers at this point.