The frame of the window is wrong when created programmatically is Swift

Originator:derdiedasdom
Number:rdar://19319300 Date Originated:20-Dec-2014 07:39 PM
Status:Closed Resolved:YES
Product:iOS SDK Product Version:8.2
Classification:Serious Bug Reproducible:Always
 
Summary:
When I try to create my user interface in code (without using xibs or storyboards) and start the app on the iPad simulator in landscape the frame of the window is still like in portrait.

Steps to Reproduce:
1. Rotate iPad simulator to landscape
2. Build and run the attached application.

Expected Results:
The view of the root view controller (and the window) fill the entire screen.

Actual Results:
The view of the root view controller (and the window) fill only part of the screen. I have set `window.clipsToBounds = true` to make the problem visible in the demo app.

Regression:
- Swift
- SDK 8.2
- iPad simulator

Notes:
Workaround: Add the code

    let frame = UIScreen.mainScreen().bounds
    window.frame = CGRect(x: 0.0, y: 0.0, width: frame.size.width+0.000_001, height: frame.size.height+0.000_001)

in application(didFinishLaunchingWithOptions:) to work around the bug (see demo 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!