modal view controller animates on state restoration

I have a strange problem with state restoration for a Universal app with Split View Controller.

The strange thing that I am doing things in a very standard way using a Storyboard and segues and with a restoration identifier for alle relevant view controllers. There is not really any code, as the logic is in the Storyboard and a minimal XCode project shows this.

The problem is with a settings screen that is shown modally as a form sheet presented from the split view controller. My view controller hierarchy ends up correct, but the transition doesn't really make sense. For some reason state restoration animates the modal controller into place.

Since the screen starts out with a screenshot from the last time the app was running, with the settings controller already present, the animation is just visual noise.

I have tried to disable animation on the segue which is respected when entering the settings interactively, but when state restoration does the same thing, the animation is there.

What is the standard way to avoid this?

Replies

I don't understand this behavior either. The whole point of state restoration is to bring the user back to the place in the app where they left off, hiding from them the fact that the app was killed while in the background. I agree, the animation makes no sense.


In my app state restoration presents the view controller modally (animating it again). There shouldn't really be an animation; it should go from the snapshot to the restored view controller.


Did you find a way around this?

Well, the only workaround I could come up with is to set the transitioningDelegate on the view controller in -decodeRestorableStateWithCoder: and hijack the modal presentation.


If anyone knows a better/easier/less code required workaround let me know.