From a08abd9baad2ebf37e4521ca3859b72a85d84fd6 Mon Sep 17 00:00:00 2001 From: Andrew Walz Date: Thu, 23 Mar 2017 09:48:20 -0600 Subject: [PATCH] Updated README --- .../DemoSwiftyCam/ViewController.swift | 1 + README.md | 19 ++++++++++++++++++- Source/SwiftyCamViewController.swift | 4 ++-- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/DemoSwiftyCam/DemoSwiftyCam/ViewController.swift b/DemoSwiftyCam/DemoSwiftyCam/ViewController.swift index a71ac3b..a51caa0 100644 --- a/DemoSwiftyCam/DemoSwiftyCam/ViewController.swift +++ b/DemoSwiftyCam/DemoSwiftyCam/ViewController.swift @@ -27,6 +27,7 @@ class ViewController: SwiftyCamViewController, SwiftyCamViewControllerDelegate { cameraDelegate = self maximumVideoDuration = 10.0 shouldUseDeviceOrientation = true + addButtons() } diff --git a/README.md b/README.md index 8a7563c..99a6264 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Configuring a Camera View Controller in AVFoundation can be tedious and time con ## Features | SwiftyCam ---------------------------|------------------------------------------------------------ +--------------------------|------------------------------- :sunglasses: | Snapchat-style media capture :+1: | Support iOS8+ :camera: | Image capture @@ -269,6 +269,14 @@ pinchToZoom = false By default, **pinchToZoom** is enabled. +You can also restrict the amount that the rear facing camera can zoom. To do this, use the `maxZoomScale` property: + +```swift +maxZoomScale = 2.0 +``` + +By default, `maxZoomScale` is set to **4.0**. + ## Camera Focus SwiftyCam, by default, support tap to focus on the video preview. SwiftyCam will set the focus and exposure levels of the session to the tapped point. While tap to set exposure is supported on both cameras, tap to focus is only supported on rear facing cameras. Autofocus and autoexposure will be resumed once SwiftyCam detects significant movement from the tapped point. To disable this feature, change the `tapToFocus` property: @@ -279,6 +287,15 @@ tapToFocus = false By default, `tapToFocus` is enabled. If you wish to show a on screen animation when a tap to focus is initiated, you can use the `SwiftyCamDidFocusAtPoint(focusPoint:)` to get the coordinates of tap and provide your own tap animation +## Device Orientation + +By default, SwiftyCam will set the photo orientation to be portrait. If you wish to preserve the orientation of the capture photos to allow support for landscape images, use the `shouldUseDeviceOrientation` property: + +```swift +shouldUseDeviceOrientation = true +``` + + ## Background Audio SwiftyCam has the ability to allow background audio to continue playing within the session, and to be captured by the video recording. By default, this is enabled. If you wish to disable this feature, change the `allowBackgroundAudio` property: diff --git a/Source/SwiftyCamViewController.swift b/Source/SwiftyCamViewController.swift index d30d463..7aa7c17 100644 --- a/Source/SwiftyCamViewController.swift +++ b/Source/SwiftyCamViewController.swift @@ -112,8 +112,8 @@ open class SwiftyCamViewController: UIViewController { /// Sets the maximum zoom scale allowed during Pinch gesture - fileprivate var maxZoomScale = CGFloat(4.0) - + public var maxZoomScale = CGFloat(4.0) + /// Sets whether Tap to Focus and Tap to Adjust Exposure is enabled for the capture session public var tapToFocus = true