question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created a year ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jpike88commented, Jul 20, 2022

I don’t have the time to go beyond my initial post. That should contain enough information to act

0reactions
jpike88commented, Jul 25, 2022

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found