Skip to content

Commit 3aafc30

Browse files
committed
Fix linter warnings
1 parent 2ba17a7 commit 3aafc30

File tree

2 files changed

+30
-9
lines changed

2 files changed

+30
-9
lines changed

BarcodeScanner.xcodeproj/project.pbxproj

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@
166166
D5B2E89B1C3A780C00C0327D /* Frameworks */,
167167
D5B2E89C1C3A780C00C0327D /* Headers */,
168168
D5B2E89D1C3A780C00C0327D /* Resources */,
169+
D5C113C9201A981500D46C9C /* SwiftLint */,
169170
);
170171
buildRules = (
171172
);
@@ -221,6 +222,23 @@
221222
};
222223
/* End PBXResourcesBuildPhase section */
223224

225+
/* Begin PBXShellScriptBuildPhase section */
226+
D5C113C9201A981500D46C9C /* SwiftLint */ = {
227+
isa = PBXShellScriptBuildPhase;
228+
buildActionMask = 2147483647;
229+
files = (
230+
);
231+
inputPaths = (
232+
);
233+
name = SwiftLint;
234+
outputPaths = (
235+
);
236+
runOnlyForDeploymentPostprocessing = 0;
237+
shellPath = /bin/sh;
238+
shellScript = "if which swiftlint >/dev/null; then\nswiftlint\nelse\necho \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi";
239+
};
240+
/* End PBXShellScriptBuildPhase section */
241+
224242
/* Begin PBXSourcesBuildPhase section */
225243
D5B2E89A1C3A780C00C0327D /* Sources */ = {
226244
isa = PBXSourcesBuildPhase;

Sources/Controllers/CameraViewController.swift

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,13 @@ public final class CameraViewController: UIViewController {
114114
public override func viewWillTransition(to size: CGSize,
115115
with coordinator: UIViewControllerTransitionCoordinator) {
116116
super.viewWillTransition(to: size, with: coordinator)
117-
coordinator.animate(alongsideTransition: { [weak self] _ in
118-
self?.setupVideoPreviewLayerOrientation()
119-
}) { [weak self] _ in
120-
self?.animateFocusView()
121-
}
117+
coordinator.animate(
118+
alongsideTransition: { [weak self] _ in
119+
self?.setupVideoPreviewLayerOrientation()
120+
},
121+
completion: ({ [weak self] _ in
122+
self?.animateFocusView()
123+
}))
122124
}
123125

124126
// MARK: - Video capturing
@@ -220,9 +222,10 @@ public final class CameraViewController: UIViewController {
220222

221223
regularFocusViewConstraints.deactivate()
222224
animatedFocusViewConstraints.activate()
223-
225+
224226
UIView.animate(
225-
withDuration: 1.0, delay:0,
227+
withDuration: 1.0,
228+
delay: 0,
226229
options: [.repeat, .autoreverse, .beginFromCurrentState],
227230
animations: ({ [weak self] in
228231
self?.view.layoutIfNeeded()
@@ -300,7 +303,7 @@ private extension CameraViewController {
300303
videoPreviewLayer.frame = view.layer.bounds
301304

302305
if let connection = videoPreviewLayer.connection, connection.isVideoOrientationSupported {
303-
switch (UIApplication.shared.statusBarOrientation) {
306+
switch UIApplication.shared.statusBarOrientation {
304307
case .portrait:
305308
connection.videoOrientation = .portrait
306309
case .landscapeRight:
@@ -336,7 +339,7 @@ private extension CameraViewController {
336339
let button = UIButton(type: .system)
337340
let title = NSAttributedString(
338341
string: localizedString("BUTTON_SETTINGS"),
339-
attributes: [.font: UIFont.boldSystemFont(ofSize: 17), .foregroundColor : UIColor.white]
342+
attributes: [.font: UIFont.boldSystemFont(ofSize: 17), .foregroundColor: UIColor.white]
340343
)
341344
button.setAttributedTitle(title, for: UIControlState())
342345
button.sizeToFit()

0 commit comments

Comments
 (0)