Skip to content

Commit

Permalink
Fix linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
vadymmarkov committed Jan 25, 2018
1 parent 2ba17a7 commit 3aafc30
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 9 deletions.
18 changes: 18 additions & 0 deletions BarcodeScanner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
D5B2E89B1C3A780C00C0327D /* Frameworks */,
D5B2E89C1C3A780C00C0327D /* Headers */,
D5B2E89D1C3A780C00C0327D /* Resources */,
D5C113C9201A981500D46C9C /* SwiftLint */,
);
buildRules = (
);
Expand Down Expand Up @@ -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;
Expand Down
21 changes: 12 additions & 9 deletions Sources/Controllers/CameraViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 3aafc30

Please sign in to comment.