6

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?

kvn
  • 1,295
  • 11
  • 28
jpsasi
  • 1,905
  • 2
  • 18
  • 29

1 Answers1

2

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.

kvn
  • 1,295
  • 11
  • 28