Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIDeviceOrientationDidChangeNotification vs. UIApplicationDidChangeStatusBarOrientationNotification

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

like image 348
dispatchswift Avatar asked Feb 01 '26 06:02

dispatchswift


1 Answers

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.

like image 177
robinson Avatar answered Feb 03 '26 09:02

robinson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!