Disclosure: I'm using XCode 13 Beta 4 and an iPhone 7 plus with iOS 15 beta 4, so this may be a new version/beta issue
I've finished the coding on HotProspects through Day 84. It works fine in the simulator, but if I switch the build target to my iPhone 7 Plus, the build will fail with the following error:
"'shared' is unavailable in application extensions for iOS: Use view controller based solutions where appropriate instead"
on line 200 of Paul's CodeScanner.swift file that was imported as a Package Dependency.
199 @objc func updateOrientation() {
200 guard let orientation = UIApplication.shared.windows.first?.windowScene?.interfaceOrientation else { return }
201 guard let connection = captureSession.connections.last, connection.isVideoOrientationSupported else { return }
202 connection.videoOrientation = AVCaptureVideoOrientation(rawValue: orientation.rawValue) ?? .portrait
203 }
Any ideas how to fix this?
UPDATE:
I found Issue 37 and see that code has been changed to address this error.
guard let orientation = view.window?.windowScene?.interfaceOrientation else { return }
However, updating the Swift Package does not pull in that modification.
What do I need to do in Swift Package Manager to access this latest code update?