Skip to content

Commit 8bb9953

Browse files
author
Christian Neil Anthony Wico
committed
Add initialCameraPosition property to the CameraViewController class.
1 parent d8b3986 commit 8bb9953

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/Controllers/CameraViewController.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public final class CameraViewController: UIViewController {
1919

2020
/// Focus view type.
2121
public var barCodeFocusViewType: FocusViewType = .animated
22+
public var initialCameraPosition: AVCaptureDevice.Position = .back
2223
public var showsCameraButton: Bool = false {
2324
didSet {
2425
cameraButton.isHidden = showsCameraButton
@@ -213,7 +214,7 @@ public final class CameraViewController: UIViewController {
213214
}
214215

215216
if error == nil {
216-
strongSelf.setupSessionInput(for: .back)
217+
strongSelf.setupSessionInput(for: strongSelf.initialCameraPosition)
217218
strongSelf.setupSessionOutput()
218219
strongSelf.delegate?.cameraViewControllerDidSetupCaptureSession(strongSelf)
219220
} else {

0 commit comments

Comments
 (0)