Addouble tap tap to switch camera

This commit is contained in:
Andrew Walz 2017-01-11 20:50:06 -07:00
parent 9f9a8a0e17
commit dbf46f720e
4 changed files with 12 additions and 3 deletions

View file

@ -2,6 +2,8 @@
## Version 1.5.0
- Added support for front-facing camera tap to adjust exposure
- Added support for double tap gesture to switch cameras
- Added doubleTapCameraSwitch property
- Updated demo application with tap animation
## Version 1.4.0

View file

@ -26,6 +26,7 @@ class ViewController: SwiftyCamViewController, SwiftyCamViewControllerDelegate {
super.viewDidLoad()
cameraDelegate = self
kMaximumVideoDuration = 10.0
doubleTapCameraSwitch = true
addButtons()
}

View file

@ -209,6 +209,12 @@ switchCamera()
Tap-to-focus, pinch-to-zoom and camera flash are not supported when the front facing camera is selected. *Switching video while video is being recorded is not currently supported*
SwiftyCam also enables switching between cameras with a double tap gesture. To disable this feature, use the `doubleTapCameraSwitch` property:
```swift
doubleTapCameraSwitch = false
```
##Configuration
SwiftyCam has several options for configurating the functionality of the capture:

View file

@ -460,8 +460,8 @@ open class SwiftyCamViewController: UIViewController {
currentCamera = .front
}
self.session.stopRunning()
session.stopRunning()
sessionQueue.async { [unowned self] in
// remove and re-add inputs and outputs
@ -539,7 +539,7 @@ open class SwiftyCamViewController: UIViewController {
}
if let device = videoDevice {
do {
do {
try device.lockForConfiguration()
if device.isFocusModeSupported(.continuousAutoFocus) {
device.focusMode = .continuousAutoFocus