简体   繁体   中英

State Restoration with Multiple Storyboards

I am working on a project with multiple storyboards. I want to implement state restoration in this project. I am having a problem linking the ViewControllers on second storyboard into the state restoration process.

encodeRestorableStateWithCoder: & decodeRestorableStateWithCoder: methods are invoked only for ViewControllers associated with the Main storyboard.

How do you link the ViewControllers in the second storyboard to the state restoration process?

When you load a class from the other storyboard you essentially need to start using the manual approach to state restoration. (aka Restoration Classes)

This means that the view controller you loaded on the second storyboard must have a restoration ID assigned and implement the UIViewControllerRestoration protocol.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM