Change min deployment target to iOS 16

This commit is contained in:
Sami Samhuri 2023-10-26 14:08:34 -07:00
parent 54a288b661
commit f87433aaf8
3 changed files with 16 additions and 20 deletions

View file

@ -294,7 +294,6 @@
ENABLE_MODULE_VERIFIER = YES;
INFOPLIST_FILE = "SwiftyCam-iOS/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@ -325,7 +324,6 @@
ENABLE_MODULE_VERIFIER = YES;
INFOPLIST_FILE = "SwiftyCam-iOS/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@ -394,7 +392,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@ -450,7 +448,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
@ -467,7 +465,6 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = QE4PFXDL4H;
INFOPLIST_FILE = DemoSwiftyCam/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@ -485,7 +482,6 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = QE4PFXDL4H;
INFOPLIST_FILE = DemoSwiftyCam/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",

View file

@ -60,19 +60,14 @@ class Orientation {
}
}
func getPreviewLayerOrientation() -> AVCaptureVideoOrientation {
func getPreviewLayerOrientation(interfaceOrientation: UIInterfaceOrientation) -> AVCaptureVideoOrientation {
// Depends on layout orientation, not device orientation
switch UIApplication.shared.statusBarOrientation {
case .portrait, .unknown:
return AVCaptureVideoOrientation.portrait
case .landscapeLeft:
return AVCaptureVideoOrientation.landscapeLeft
case .landscapeRight:
return AVCaptureVideoOrientation.landscapeRight
case .portraitUpsideDown:
return AVCaptureVideoOrientation.portraitUpsideDown
@unknown default:
return .portrait
switch interfaceOrientation {
case .portrait, .unknown: return .portrait
case .landscapeLeft: return .landscapeLeft
case .landscapeRight: return .landscapeRight
case .portraitUpsideDown: return .portraitUpsideDown
@unknown default: return .portrait
}
}

View file

@ -394,6 +394,10 @@ open class SwiftyCamViewController: UIViewController {
override open func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
guard let interfaceOrientation = view.window?.windowScene?.interfaceOrientation else {
return
}
// Subscribe to device rotation notifications
if shouldUseDeviceOrientation {
@ -413,7 +417,8 @@ open class SwiftyCamViewController: UIViewController {
// Preview layer video orientation can be set only after the connection is created
DispatchQueue.main.async {
self.previewLayer.videoPreviewLayer.connection?.videoOrientation = self.orientation.getPreviewLayerOrientation()
let layerOrientation = self.orientation.getPreviewLayerOrientation(interfaceOrientation: interfaceOrientation)
self.previewLayer.videoPreviewLayer.connection?.videoOrientation = layerOrientation
}
case .notAuthorized:
@ -945,7 +950,7 @@ extension SwiftyCamViewController {
private var firstCaptureDevice: AVCaptureDevice? {
AVCaptureDevice.DiscoverySession(
deviceTypes: [.builtInDualCamera, .builtInWideAngleCamera],
deviceTypes: [.builtInTripleCamera, .builtInDualCamera, .builtInWideAngleCamera],
mediaType: .video,
position: .unspecified
).devices.first