From da7f9fa254b6c02abbc01fd994974e6ed62f4e28 Mon Sep 17 00:00:00 2001 From: Sebastian Villena <97059974+ruisebas@users.noreply.github.com> Date: Thu, 11 Jul 2024 15:44:33 -0400 Subject: [PATCH] fix: Updating the camera frame position when the subviews are laid out (#158) --- HostApp/HostApp.xcodeproj/project.pbxproj | 4 ---- .../FaceLiveness/Views/Liveness/LivenessViewController.swift | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/HostApp/HostApp.xcodeproj/project.pbxproj b/HostApp/HostApp.xcodeproj/project.pbxproj index f318bc2d..7d1314c5 100644 --- a/HostApp/HostApp.xcodeproj/project.pbxproj +++ b/HostApp/HostApp.xcodeproj/project.pbxproj @@ -34,7 +34,6 @@ 97D1A8E92BA3757700FF1368 /* AWSAPIPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 97D1A8E82BA3757700FF1368 /* AWSAPIPlugin */; }; 97D1A8EB2BA3757700FF1368 /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 97D1A8EA2BA3757700FF1368 /* AWSCognitoAuthPlugin */; }; 97D1A8ED2BA3757700FF1368 /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 97D1A8EC2BA3757700FF1368 /* Amplify */; }; - 97D1A8EF2BA375AA00FF1368 /* amplify-ui-swift-liveness in Resources */ = {isa = PBXBuildFile; fileRef = 97D1A8EE2BA375AA00FF1368 /* amplify-ui-swift-liveness */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -308,8 +307,6 @@ Base, ); mainGroup = 9070FF97285112B4009867D5; - packageReferences = ( - ); productRefGroup = 9070FFA1285112B4009867D5 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -328,7 +325,6 @@ files = ( 973619262BA378690003A590 /* awsconfiguration.json in Resources */, 9070FFAB285112B5009867D5 /* Preview Assets.xcassets in Resources */, - 97D1A8EF2BA375AA00FF1368 /* amplify-ui-swift-liveness in Resources */, 9070FFA8285112B5009867D5 /* Assets.xcassets in Resources */, 973619252BA378690003A590 /* amplifyconfiguration.json in Resources */, ); diff --git a/Sources/FaceLiveness/Views/Liveness/LivenessViewController.swift b/Sources/FaceLiveness/Views/Liveness/LivenessViewController.swift index 5e698f23..c274bde0 100644 --- a/Sources/FaceLiveness/Views/Liveness/LivenessViewController.swift +++ b/Sources/FaceLiveness/Views/Liveness/LivenessViewController.swift @@ -52,6 +52,10 @@ final class _LivenessViewController: UIViewController { setupAVLayer() } + override func viewDidLayoutSubviews() { + previewLayer?.position = view.center + } + private func layoutSubviews() { freshnessView.translatesAutoresizingMaskIntoConstraints = false