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.
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- Get the NSRange for the visible text after scroll
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
- didBeginContact:(SKPhysicsContact *)contact not in
- Attempt to present UIAlertController on View Contr
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.