In Swift, how to get the device orientation correctly right after it's launched?
问题 I use following code to see if the device is in landscape mode or not: UIDevice.currentDevice().orientation.isLandscape.boolValue It works BUT if I put my device in landscape mode before the app is launched, and after viewDidLoad , I call this line of code, it always returns false . If I use this instead: interfaceOrientation.isLandscape it returns true , which is correct, but the compiler is showing a warning that interfaceOrientation was deprecated in iOS 8.0 . What is the correct way to