iOS orientation not being listened to
See original GitHub issue@kkafar You guys are missing [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]
from this library’s initialisation, meaning that reported orientations on my test device (iOS 15, iPhone 11 Pro) kept returning UIDeviceOrientationUnknown
from [UIDevice currentDevice].orientation
, causing enforceDesiredDeviceOrientation
to function incorrectly. The result was my device didn’t change orientation when rotated, even though Xcode settings let any orientation happen.
Added the above code to my AppDelegate fixed this issue.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Device orientation on only 1 view controller? in objective c
How do i programatically set a device orientation for only one view controller, and remianing all the view controller set to the protrait...
Read more >How to detect orientation change? - ios - Stack Overflow
I like checking the orientation notification because you can add this feature in any class, no needs to be a view or a...
Read more >How to detect device rotation - a free SwiftUI by Example tutorial
Yes, on iPhone a landscape orientation means you have more horizontal space than vertical, but on iPad it's possible for your app to...
Read more >Detecting And Handling iOS Device Orientation Without KVO
Our App is broken. For now, there is no possible way to detect rotation changes with Portrait Lock Screen turned on. Using KVO...
Read more >Managing screen orientation - Web APIs - MDN Web Docs
The term screen orientation refers to whether a browser viewport ... Cras commodo quam non tortor consectetur eget rutrum dolor ultricies.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I don’t have the time to go beyond my initial post. That should contain enough information to act
What made it super confusing was that this worked fine on my simulator (iOS 15, iPhone 12), but refused to work on my real iPhone till I added that line of code. I suspect this is a deeper issue with Apple