UIWindow view hierarchy disappears when dismissing view controller with custom presentation

Originator:ash.furrow
Number:rdar://17567668 Date Originated:July 5, 2014
Status:Open Resolved:
Product:Developer Toos Product Version:iOS 8 Beta 2
Classification:Other Bug Reproducible:Always
 
The app's keyWindow loses its entire view hierarchy once the presented view controller is dismissed, when using the custom view controller transitions API.

Sample Code: http://cloud.ashfurrow.com/1Q2k0Y28242M

Comments

I was facing the same issue and there's no need for a workaround. This comment explains what's happening https://stackoverflow.com/a/25901154/3641812 I got it working.

By ricardopereira.eu at May 24, 2018, 1:59 p.m. (reply...)

How to use the Workaround

@permakittens where should we use that line? When the transition is cancelled? In the AppDelegate?

By david.cespedes at Dec. 6, 2016, 2:55 p.m. (reply...)

Does this have any updates?

By vedran.burojevic at Aug. 11, 2015, 7:42 a.m. (reply...)

I am also facing the same problem in GM.

By antonelli.mike at Jan. 14, 2015, 4:33 p.m. (reply...)

Facing the same problem, also still seems to be present in the GM

Confirming here it is still in GM.

Facing same problem

I am facing same problem. Any update on resolution or work around for this issue ?

By kaustubh.kabra at Aug. 26, 2014, 10:15 a.m. (reply...)

Workaround

I've been meaning to check to see if this was resolved in Beta-7 but don't have that version on this laptop and have slow wifi atm. @kaustubh workaround I've found while Googling answer is to add the subview back to the window:

UIApplication.sharedApplication().keyWindow!.addSubview(toView)

Note that if you're doing an interactive transition, and the transition was cancelled it would be fromView that you add.

By permakittens at Sept. 5, 2014, 3:52 p.m. (reply...)

Spoke too soon

Still seems to be a problem in Beta-7 in some situations :(

By mathew.sanders at Sept. 7, 2014, 6:52 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!