iOS 13.1.2: iOS ARSCNView orientation wrong when supportedInterfaceOrientations == .portrait

Anybody else seeing something similar to this? (I've just reported it via Feedback Assistant)


iOS 13.1.2 is misbehaving when supportedInterfaceOrientations == .portrait:


1. In Xcode, create new “Augmented Reality App” project.

2. In ViewController.swift/viewDidLoad(), add debug UI:

sceneView.debugOptions = [ARSCNDebugOptions.showFeaturePoints, ARSCNDebugOptions.showWorldOrigin]

3. In ViewContoller.swift, add:

override var supportedInterfaceOrientations: UIInterfaceOrientationMask {

return .portrait

}


4. Using an iOS 12 device, hold device in landscape-right orientation and launch the app.

=> As expected, camera image is rotated counterclockwise.

=> As expected, the AR model and AR axes are also rotated counterclockwise.

=> As expected, feature points appear reasonable.


5. Using an iOS 13.1.2 device, hold device in landscape-right orientation and launch the app.

=> As expected, camera image is rotated counterclockwise.

=> Unexpectedly, the AR model and AR axes are NOT rotated counterclockwise.

=> Unexpectedly, feature points appear quite wrong.

Replies

I am expericing this issue in iOS 13.2, as well. Plane detection and models are rotated in a portrait orientation locked app. Where you able to find a workaround?

Nope, so far no workaround, and no response yet from Apple here, nor via Feedback Assistant, nor in response to my Technical Support Incident.

Just rechecked today, on iOS 13.3.1, and everything is now looking good!


HSChris, how about you?


[Edited to add:]


Well, actually, everything is now looking good, but also looking different than in iOS 12.


6. Using an iOS 13.3.1 device, hold device in landscape-right orientation and launch the app.

=> Camera image is NOT rotated counterclockwise.

=> The AR model and AR axes are NOT rotated counterclockwise.

=> Feature points appear correct.


That is:

- In iOS 12, the camera image is rotated and the AR elements are also rotated a matching amount.

- In iOS 13.1, the camera image is rotated but the AR elements are not rotated.

- In iOS 13.3, neither the camera image nor the AR elements are rotated.


I'm not sure whether it's the iOS 12 or the iOS 13.3 behavior that is correct, but at least both are self-consistent.


Still, seems like different behavior between versions, without documentation (AFAIK), isn't optimal.

I am having the same issues with landscapeLeft orientation and I'm on IOS 13.3.1

Hi. We are come across this bug. Managed to get around this by programmatically changing interface orientation. Not very good…

Code Block Swift
class AppDelegate: UIResponder, UIApplicationDelegate {
    var window: UIWindow?
    var orientationMask: UIInterfaceOrientationMask = .allButUpsideDown
    func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
        return orientationMask
    }
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        UIDevice.current.setValue(NSNumber(value: UIInterfaceOrientation.landscapeLeft.rawValue), forKey: "orientation")
        let deadlineTime = DispatchTime.now() + .seconds(1)
        DispatchQueue.main.asyncAfter(deadline: deadlineTime) {
            UIDevice.current.setValue(NSNumber(value: UIInterfaceOrientation.portrait.rawValue), forKey: "orientation")
            self.orientationMask = .portrait
        }
        return true
    }
...