From 67ff337423024cdee135dc5010982194cacec5b8 Mon Sep 17 00:00:00 2001 From: Andrew Walz Date: Sun, 15 Jan 2017 17:12:21 -0700 Subject: [PATCH] Added default camera functionality' --- DemoSwiftyCam/DemoSwiftyCam/ViewController.swift | 2 -- Source/SwiftyCamViewController.swift | 11 +++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/DemoSwiftyCam/DemoSwiftyCam/ViewController.swift b/DemoSwiftyCam/DemoSwiftyCam/ViewController.swift index 13a26ef..6a24db8 100644 --- a/DemoSwiftyCam/DemoSwiftyCam/ViewController.swift +++ b/DemoSwiftyCam/DemoSwiftyCam/ViewController.swift @@ -26,9 +26,7 @@ class ViewController: SwiftyCamViewController, SwiftyCamViewControllerDelegate { super.viewDidLoad() cameraDelegate = self maximumVideoDuration = 10.0 - doubleTapCameraSwitch = true addButtons() - } override var prefersStatusBarHidden: Bool { diff --git a/Source/SwiftyCamViewController.swift b/Source/SwiftyCamViewController.swift index 4b551d2..0370a9b 100644 --- a/Source/SwiftyCamViewController.swift +++ b/Source/SwiftyCamViewController.swift @@ -127,7 +127,11 @@ open class SwiftyCamViewController: UIViewController { public var doubleTapCameraSwitch = true + /// Set default launch camera + public var defaultCamera = CameraSelection.rear + + // MARK: Public Get-only Variable Declarations /// Returns true if video is currently being recorded @@ -482,6 +486,13 @@ open class SwiftyCamViewController: UIViewController { guard setupResult == .success else { return } + + // Set default camera + + currentCamera = defaultCamera + + // begin configuring session + session.beginConfiguration() configureVideoPreset() addVideoInput()