3

In order to set the videoOrientation of an AVCaptureSession, I need to know the current orientation the user is in (i.e. portrait, landscapeLeft, etc.).

  • Using UIDevice.current.orientation always returns unknown, even when initiating device orientation changes with UIDevice.current.beginGeneratingDeviceOrientationNotifications() and UIDevice.current.isGeneratingDeviceOrientationNotifications is returning true

  • Apple has deprecated interfaceOrientation for the UIViewController.

  • Trying UIApplication.shared.statusBarOrientation yields 1 Error and 1 Warning:

    • Error: 'shared' is unavailable in application extensions for iOS: Use view controller based solutions where appropriate instead.
    • Warning: 'statusBarOrientation' was deprecated in iOS 13.0: Use the interfaceOrientation property of the window scene instead.

There does not appear to be a window scene at all in Messages App Extensions.

Does anyone know how to detect the orientation from a Messages Extension? Ultimately I'm trying to re-create a camera view in landscape since UIImagePickerController does not support landscape for the Camera.

monkee
  • 4,751
  • 3
  • 21
  • 30

0 Answers0