diff --git a/BarcodeScanner.xcodeproj/project.pbxproj b/BarcodeScanner.xcodeproj/project.pbxproj index 66c0a6f..aab7016 100644 --- a/BarcodeScanner.xcodeproj/project.pbxproj +++ b/BarcodeScanner.xcodeproj/project.pbxproj @@ -166,6 +166,7 @@ D5B2E89B1C3A780C00C0327D /* Frameworks */, D5B2E89C1C3A780C00C0327D /* Headers */, D5B2E89D1C3A780C00C0327D /* Resources */, + D5C113C9201A981500D46C9C /* SwiftLint */, ); buildRules = ( ); @@ -221,6 +222,23 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + D5C113C9201A981500D46C9C /* SwiftLint */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = SwiftLint; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "if which swiftlint >/dev/null; then\nswiftlint\nelse\necho \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi"; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ D5B2E89A1C3A780C00C0327D /* Sources */ = { isa = PBXSourcesBuildPhase; diff --git a/Sources/Controllers/CameraViewController.swift b/Sources/Controllers/CameraViewController.swift index 18d411a..d969e63 100644 --- a/Sources/Controllers/CameraViewController.swift +++ b/Sources/Controllers/CameraViewController.swift @@ -114,11 +114,13 @@ public final class CameraViewController: UIViewController { public override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { super.viewWillTransition(to: size, with: coordinator) - coordinator.animate(alongsideTransition: { [weak self] _ in - self?.setupVideoPreviewLayerOrientation() - }) { [weak self] _ in - self?.animateFocusView() - } + coordinator.animate( + alongsideTransition: { [weak self] _ in + self?.setupVideoPreviewLayerOrientation() + }, + completion: ({ [weak self] _ in + self?.animateFocusView() + })) } // MARK: - Video capturing @@ -220,9 +222,10 @@ public final class CameraViewController: UIViewController { regularFocusViewConstraints.deactivate() animatedFocusViewConstraints.activate() - + UIView.animate( - withDuration: 1.0, delay:0, + withDuration: 1.0, + delay: 0, options: [.repeat, .autoreverse, .beginFromCurrentState], animations: ({ [weak self] in self?.view.layoutIfNeeded() @@ -300,7 +303,7 @@ private extension CameraViewController { videoPreviewLayer.frame = view.layer.bounds if let connection = videoPreviewLayer.connection, connection.isVideoOrientationSupported { - switch (UIApplication.shared.statusBarOrientation) { + switch UIApplication.shared.statusBarOrientation { case .portrait: connection.videoOrientation = .portrait case .landscapeRight: @@ -336,7 +339,7 @@ private extension CameraViewController { let button = UIButton(type: .system) let title = NSAttributedString( string: localizedString("BUTTON_SETTINGS"), - attributes: [.font: UIFont.boldSystemFont(ofSize: 17), .foregroundColor : UIColor.white] + attributes: [.font: UIFont.boldSystemFont(ofSize: 17), .foregroundColor: UIColor.white] ) button.setAttributedTitle(title, for: UIControlState()) button.sizeToFit()