dispatchswift
dispatchswift

Reputation: 1056

UIDeviceOrientationDidChangeNotification vs. UIApplicationDidChangeStatusBarOrientationNotification

What are the differences between the two and in what cases should I use one over the other?

Upvotes: 3

Views: 326

Answers (1)

robinson
robinson

Reputation: 11

typedef NS_ENUM(NSInteger, UIInterfaceOrientation) {
UIInterfaceOrientationUnknown            = UIDeviceOrientationUnknown,
UIInterfaceOrientationPortrait           = UIDeviceOrientationPortrait,
UIInterfaceOrientationPortraitUpsideDown = UIDeviceOrientationPortraitUpsideDown,
UIInterfaceOrientationLandscapeLeft      = UIDeviceOrientationLandscapeRight,
UIInterfaceOrientationLandscapeRight     = UIDeviceOrientationLandscapeLeft

}

see from the above, difference at UIInterfaceOrientationLandscapeLeft equal to UIDeviceOrientationLandscapeRight,UIInterfaceOrientationLandscapeRight equal to UIDeviceOrientationLandscapeLeft. when device landscapeLeft,interface should rotate to right to keep content not reverse.

Upvotes: 1

Related Questions