“From View Controller” disappears using UIViewControllerContextTransitioning

I was having the same problem here – looks like a bug in iOS 8. I’ve filed a radar.

I used Reveal to inspect the view hierarchy after the screen goes black. The key UIWindow is completely empty – no view hierarchy at all!

Reveal'd

I played around a bit and it looks like there is an easy workaround, for simple cases. You can just re-add the toViewController‘s view as a subview of the key window’s:

transitionContext.completeTransition(true)
UIApplication.sharedApplication().keyWindow!.addSubview(toViewController.view)

I’ve checked and the key window’s rootViewController is still correctly set, so that’s fine. I’m not sure what would happen if you presented your controller from within an already presented modal controller, so for more complex cases, you’ll have to experiment around.

Leave a Comment