-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8a89d86
commit b51c4ad
Showing
295 changed files
with
127,784 additions
and
64,535 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
53 changes: 53 additions & 0 deletions
53
AcuantCamera/AcuantCamera/Camera/Barcode/BarcodeCameraOptions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// | ||
// BarcodeCameraOptions.swift | ||
// AcuantCamera | ||
// | ||
// Created by Federico Nicoli on 7/12/22. | ||
// Copyright © 2022 Acuant. All rights reserved. | ||
// | ||
|
||
@objc public enum BarcodeCameraState: Int { | ||
case align | ||
case capturing | ||
} | ||
|
||
@objcMembers public class BarcodeCameraOptions: CameraOptions { | ||
public let waitTimeAfterCapturingInSeconds: Int | ||
public let timeoutInSeconds: Int | ||
public let textForState: (BarcodeCameraState) -> String | ||
public let colorForState: (BarcodeCameraState) -> CGColor | ||
|
||
public init(hideNavigationBar: Bool = true, | ||
showBackButton: Bool = true, | ||
waitTimeAfterCapturingInSeconds: Int = 1, | ||
timeoutInSeconds: Int = 20, | ||
placeholderImageName: String? = "barcode_placement_overlay", | ||
textForState: @escaping (BarcodeCameraState) -> String = { state in | ||
switch state { | ||
case .align: return "CAPTURE BARCODE" | ||
case .capturing: return "CAPTURING" | ||
@unknown default: return "" | ||
} | ||
}, | ||
colorForState: @escaping (BarcodeCameraState) -> CGColor = { state in | ||
switch state { | ||
case .align: return UIColor.white.cgColor | ||
case .capturing: return UIColor.green.cgColor | ||
@unknown default: return UIColor.white.cgColor | ||
} | ||
}, | ||
textForCameraPaused: String = "CAMERA PAUSED", | ||
backButtonText: String = "BACK") { | ||
self.waitTimeAfterCapturingInSeconds = waitTimeAfterCapturingInSeconds | ||
self.timeoutInSeconds = timeoutInSeconds | ||
self.textForState = textForState | ||
self.colorForState = colorForState | ||
super.init(hideNavigationBar: hideNavigationBar, | ||
showBackButton: showBackButton, | ||
placeholderImageName: placeholderImageName, | ||
bracketLengthInHorizontal: 0, | ||
bracketLengthInVertical: 0, | ||
textForCameraPaused: textForCameraPaused, | ||
backButtonText: backButtonText) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
AcuantCamera/AcuantCamera/Camera/Barcode/BarcodeCameraViewControllerDelegate.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// | ||
// BarcodeCameraDelegate.swift | ||
// AcuantCamera | ||
// | ||
// Created by Federico Nicoli on 9/8/21. | ||
// Copyright © 2021 Acuant. All rights reserved. | ||
// | ||
|
||
@objc public protocol BarcodeCameraViewControllerDelegate: AnyObject { | ||
func onCaptured(barcode: String?) | ||
} |
11 changes: 0 additions & 11 deletions
11
AcuantCamera/AcuantCamera/Camera/Barcode/BarcodeCaptureDelegate.swift
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.