-
Notifications
You must be signed in to change notification settings - Fork 330
Closed
Description
'shared' is unavailable: Use view controller based solutions where appropriate instead.
I use QRCodeReader in an app extension. Xcode reports the error in,
@objc public func setNeedsUpdateOrientation() {
setNeedsDisplay()
overlayView?.setNeedsDisplay()
if let connection = reader?.previewLayer.connection, connection.isVideoOrientationSupported {
let application = UIApplication.shared
let orientation = UIDevice.current.orientation
let supportedInterfaceOrientations = application.supportedInterfaceOrientations(for: application.keyWindow)
connection.videoOrientation = QRCodeReader.videoOrientation(deviceOrientation: orientation, withSupportedOrientations: supportedInterfaceOrientations, fallbackOrientation: connection.videoOrientation)
}
}
UIApplication.shared
is not available in app extension.
Metadata
Metadata
Assignees
Labels
No labels