Enable save and restore to add the following two methods to the application delegate of the AppDelegate. m file:
RestorationldentifierUIKite does not automatically store all information about the application status. You need to tell UIKit which view controllers you need to participate in. You need to assign a Restoration Identifier to these view controllers in the storyboard. Any content with a Restoration ID will be protected and restored. So far, the system can only help you restore to a specific view controller, and then regenerate the objects in the Controller to let the system know which objects you need to save. You need to implement two methods.
When you press the home Key in the program, you will call encodeRestorableStateWithCoder: to save the object you want to save. The next time you open the program, you will call decodeRestorableStateWithCoder: to restore the previously saved objects.