iosiphoneobjective-cseguestate-restoration

Embed Segue Destination View Controllers Are Excluded From UI State Restoration


My app uses embed segues to show multiple view controllers on screen at once. I'm trying to implement UIKit state restoration, but the framework is not asking my embedded view controllers to encode and decode their states. This happens automatically with all other types of segues.

Is UIKit state restoration possible with embed segues?

Here is an example application which demonstrates this issue: https://github.com/paulhimes/RestoreEmbeddedTest


Solution

  • Based on the project you linked to, the trick is to encode the embedded VC from the encode implementation of the container VC.