UIWindow rootViewController transition issue
| Originator: | yonic.surny | ||
| Number: | rdar://32789860 | Date Originated: | 6/15/2017 |
| Status: | Open | Resolved: | |
| Product: | iOS+SDK UIKit | Product Version: | iOS 10.3 |
| Classification: | Bug | Reproducible: | Always |
Area:
UIKit
Summary:
When replacing the rootViewController of a UIWindow from a simple UIViewController to a UITabBarController of UINavigationControllers using a standard dissolve animation, the navigation bar appears too high (apparently the height of the status bar) then "drops".
UIView.transition(with: self, duration: 0.3, options: .transitionCrossDissolve, animations: {
self.rootViewController = controller
}, completion: nil)
Steps to Reproduce:
Replace the rootViewController of a UIWindow using a standard cross dissolve animation.
Expected Results:
The new view controller (and child view controllers) appears with a nice fade animation.
Observed Results:
The new view controller appears misplaced (or part of the UI) then abruptly replaces itself correctly at the end of the animation.
Version:
Xcode 8.3 (iOS 10)
Xcode 9 (iOS 11)
Notes:
A solution is to use a custom animation by making a screenshot, adding the screenshot to the window, adding the new tab bar controller view below the screenshot, animating the dissolve of the screenshot then replacing the root controller of the window.
See https://github.com/saeros/radar-NBI for an example project
Comments
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!