Skip to content

Commit

Permalink
fixed issue with coccopods
Browse files Browse the repository at this point in the history
  • Loading branch information
sMaltsevAcuant committed Sep 1, 2021
1 parent be434d1 commit b929bb6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import AVFoundation

extension UIInterfaceOrientation {

var videoOrientation: AVCaptureVideoOrientation? {
var faceCaptureVideoOrientation: AVCaptureVideoOrientation? {
switch self {
case .portraitUpsideDown: return .portraitUpsideDown
case .landscapeRight: return .landscapeRight
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit

extension UIWindow {

var interfaceOrientation: UIInterfaceOrientation? {
var faceCaptureInterfaceOrientation: UIInterfaceOrientation? {
if #available(iOS 13, *) {
return windowScene?.interfaceOrientation
} else {
Expand Down
12 changes: 6 additions & 6 deletions AcuantFaceCapture/AcuantFaceCapture/FaceCaptureController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public class FaceCaptureController: UIViewController {
coordinator.animate(alongsideTransition: { [weak self] context in
guard let self = self else { return }

self.rotateCameraPreview(to: self.view.window?.interfaceOrientation)
self.rotateCameraPreview(to: self.view.window?.faceCaptureInterfaceOrientation)
self.handleRotateToPortraitAlertIfPhone()
})
}
Expand Down Expand Up @@ -104,7 +104,7 @@ public class FaceCaptureController: UIViewController {
private func handleRotateToPortraitAlertIfPhone() {
guard
UIDevice.current.userInterfaceIdiom == .phone,
let interfaceOrientation = self.view.window?.interfaceOrientation
let interfaceOrientation = self.view.window?.faceCaptureInterfaceOrientation
else {
return
}
Expand Down Expand Up @@ -193,7 +193,7 @@ public class FaceCaptureController: UIViewController {
}

view.layer.addSublayer(videoPreviewLayer)
rotateCameraPreview(to: view.window?.interfaceOrientation)
rotateCameraPreview(to: view.window?.faceCaptureInterfaceOrientation)
addNavigationBackButton()
} else {
navigationController?.popViewController(animated: true)
Expand All @@ -208,7 +208,7 @@ public class FaceCaptureController: UIViewController {
}

videoPreviewLayer.frame = view.bounds
connection.videoOrientation = orientation.videoOrientation ?? .portrait
connection.videoOrientation = orientation.faceCaptureVideoOrientation ?? .portrait

topOverlayLayer.path = createRectanglePath().cgPath
imageLayer?.setFrame(view.bounds)
Expand Down Expand Up @@ -275,7 +275,7 @@ public class FaceCaptureController: UIViewController {
y: 1 - ((faceRect.origin.y) / aperture.height + (faceRect.height) / aperture.height),
width: (faceRect.width + 150) / aperture.width,
height: faceRect.height / aperture.height)
if let orientation = view.window?.interfaceOrientation, orientation.isLandscape {
if let orientation = view.window?.faceCaptureInterfaceOrientation, orientation.isLandscape {
scaled = CGRect(x: faceRect.origin.x / aperture.width,
y: 1 - ((faceRect.origin.y) / aperture.height + (faceRect.height) / aperture.height),
width: faceRect.width / aperture.width,
Expand All @@ -290,7 +290,7 @@ public class FaceCaptureController: UIViewController {
point4: CGPoint(x: faceRect.origin.x, y: faceRect.origin.y + faceRect.size.height))
} else {
self.faceOval?.isHidden = true
if let orientation = view.window?.interfaceOrientation, orientation.isLandscape {
if let orientation = view.window?.faceCaptureInterfaceOrientation, orientation.isLandscape {
cornerlayer.setHorizontalDefaultCorners(frame: view.bounds)
} else {
cornerlayer.setDefaultCorners(frame: view.bounds)
Expand Down
4 changes: 3 additions & 1 deletion AcuantiOSSDKV11.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ Pod::Spec.new do |s|
acuantFaceCapture.ios.deployment_target = '11.0'

acuantFaceCapture.source_files =
"AcuantFaceCapture/AcuantFaceCapture/*.{h,swift}"
"AcuantFaceCapture/AcuantFaceCapture/*.{h,swift}",
"AcuantFaceCapture/AcuantFaceCapture/View/*.{h,swift}",
"AcuantFaceCapture/AcuantFaceCapture/Extension/*.{h,swift}"

acuantFaceCapture.dependency "#{s.name}/AcuantCommon"
acuantFaceCapture.dependency "#{s.name}/AcuantImagePreparation"
Expand Down
2 changes: 1 addition & 1 deletion SampleApp/SampleApp/FaceLivenessCameraController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ class FaceLivenessCameraController: UIViewController, AcuantHGLiveFaceCaptureDel

//MARK: - Orientation extensions

extension UIWindow {
internal extension UIWindow {

var interfaceOrientation: UIInterfaceOrientation? {
if #available(iOS 13, *) {
Expand Down

0 comments on commit b929bb6

Please sign in to comment.