diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..b63ebb1 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,9 @@ +# CHANGELOG + +## Version 1.2.0 + +- Enabling flash is now a boolean property rather than a function +- Flash for photos only flashes when photo is taken. +- Flash for videos enables the torch when video begins recording and disables flash when video finishes +- Fixed issue where **SwiftyCamDidChangeZoomLevel(zoomLevel:)** would be called from pinch gestures from front camera +- Minor bug fixes and enhancements \ No newline at end of file diff --git a/README.md b/README.md index a296233..8e829e3 100644 --- a/README.md +++ b/README.md @@ -137,11 +137,11 @@ and in your viewDidLoad, assign the cameraDelegate to self: ## Flash -The flash(torch) can be enabled on the device by calling: +The flash(torch) can be enabled by changing the **flashEnabled** property: - toggleFlash() + flashEnabled = true -The flash will only be enabled if the current camera is the rear camera and will automatically if the camera switches or the View Controller is dismissed. +The flash will only be enabled if the current camera is the rear camera. For photos, the camera will flash much like the stock iOS camera. For video, the torch(flash) will enable for the duration of the video capture. ## Switching Camera diff --git a/Source/SwiftyCamViewController.swift b/Source/SwiftyCamViewController.swift index 39988d5..43ef413 100644 --- a/Source/SwiftyCamViewController.swift +++ b/Source/SwiftyCamViewController.swift @@ -380,7 +380,7 @@ open class SwiftyCamViewController: UIViewController { // Used for Tap to Focus override open func touchesBegan(_ touches: Set, with event: UIEvent?) { - guard tapToFocus == true, currentCamera == .rear else { + guard tapToFocus == true && currentCamera == .rear else { // Ignore taps return } @@ -569,7 +569,7 @@ open class SwiftyCamViewController: UIViewController { // Handle zoom gesture @objc fileprivate func zoomGesture(pinch: UIPinchGestureRecognizer) { - guard pinchToZoom == true else { + guard pinchToZoom == true && self.currentCamera == .rear else { //ignore pinch if pinchToZoom is set to false return }