Updated README

This commit is contained in:
Andrew Walz 2017-08-25 14:51:17 -06:00
parent fa6e301806
commit a94043d5ac

View file

@ -1,4 +1,4 @@
<img src="SwiftyCamBanner.jpg" align="center">
<img src="SwiftyCamBanner.jpg" align="center">
<p align="center">
<img src="https://img.shields.io/badge/platform-iOS%208%2B-blue.svg?style=flat" alt="Platform: iOS 8+"/>
@ -13,10 +13,12 @@ SwiftyCam is a a simple, Snapchat-style iOS Camera framework for easy photo and
Configuring a Camera View Controller in AVFoundation can be tedious and time consuming. SwiftyCam is a drop in View Controller which gives complete control of the AVSession.
### For Swift 4 support, see Swift4 branch
## Features
| | SwiftyCam
| ------------------------------------- | ---------------------
| ------------------------------------- | ---------------------
| :sunglasses: | Snapchat-style media capture
| :+1: | Support iOS8+
| :camera: | Image capture
@ -29,7 +31,7 @@ Configuring a Camera View Controller in AVFoundation can be tedious and time con
| :lock: | Supports manual focus
| :last_quarter_moon_with_face: | Low light setting
| :speaker: | Background audio support
## Requirements
@ -127,13 +129,13 @@ Capturing Video is just as easy. To begin recording video, call the `startVideoR
```swift
startVideoRecording()
```
```
To end the capture of a video, call the `stopVideoRecording` function:
```swift
stopVideoRecording()
```
```
### Delegate
@ -142,7 +144,7 @@ In order to acquire the photos and videos taken by either the SwiftyCamButton or
```swift
class MyCameraViewController : SwiftyCamViewController, SwiftyCamViewControllerDelegate {
override func viewDidLoad() {
super.viewDidLoad()
cameraDelegate = self
@ -158,34 +160,34 @@ func swiftyCam(_ swiftyCam: SwiftyCamViewController, didTake photo: UIImage) {
// Called when takePhoto() is called or if a SwiftyCamButton initiates a tap gesture
// Returns a UIImage captured from the current session
}
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didBeginRecordingVideo camera: SwiftyCamViewController.CameraSelection) {
// Called when startVideoRecording() is called
// Called when startVideoRecording() is called
// Called if a SwiftyCamButton begins a long press gesture
}
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didFinishRecordingVideo camera: SwiftyCamViewController.CameraSelection) {
// Called when stopVideoRecording() is called
// Called when stopVideoRecording() is called
// Called if a SwiftyCamButton ends a long press gesture
}
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didFinishProcessVideoAt url: URL) {
// Called when stopVideoRecording() is called and the video is finished processing
// Returns a URL in the temporary directory where video is stored
}
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didFocusAtPoint point: CGPoint) {
// Called when a user initiates a tap gesture on the preview layer
// Will only be called if tapToFocus = true
// Returns a CGPoint of the tap location on the preview layer
}
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didChangeZoomLevel zoom: CGFloat) {
// Called when a user initiates a pinch gesture on the preview layer
// Will only be called if pinchToZoomn = true
// Returns a CGFloat of the current zoom level
}
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didSwitchCameras camera: SwiftyCamViewController.CameraSelection) {
// Called when user switches between cameras
// Returns current camera selection
@ -199,8 +201,8 @@ The flash(torch) can be enabled by changing the `flashEnabled` property:
```swift
flashEnabled = true
```
Flash is now supported for front and rear facing cameras.
Flash is now supported for front and rear facing cameras.
### Rear Camera
@ -247,7 +249,7 @@ SwiftyCam has several options for configurating the functionality of the capture
Video quality can be set by the **videoQuality** property of SwiftyCamViewController. The choices available correspond to the matching **AVCaptureSessionPreset**:
| VideoQuality | AVCaptureSessionPreset
| ------------------------------------- | ---------------------
| ------------------------------------- | ---------------------
| `.high` | **AVCapturePresetHigh**
| `.medium` | **AVCapturePresetMedium**
| `.low` | **AVCapturePresetLow**
@ -258,7 +260,7 @@ Video quality can be set by the **videoQuality** property of SwiftyCamViewContro
| `.resolution3840x2160` | **AVCaptureSessionPreset3840x2160**
| `.iframe960x540` | **AVCaptureSessionPresetiFrame960x540**
| `.iframe1280x720` | **AVCaptureSessionPresetiFrame1280x720**
The default value is **.high**. For use with the front-facing camera, **.high** will always be used.
@ -292,7 +294,7 @@ By default, ```swipeToZoom``` is enabled. The default gestures zoom in the captu
```swift
swipeToZoomInverted = true
```
```
You can also restrict the amount that the rear facing camera can zoom. To do this, use the `maxZoomScale` property:
@ -339,7 +341,7 @@ lowLightBoost = false
## Privacy
When a user firsts launch SwiftyCamViewController, they will be prompted for permission for access to the cameras and microphones. By default, if a user declines access to the hardware, SwiftyCam will provide a prompt to the App privacy settings inside the iOS settings application.
When a user firsts launch SwiftyCamViewController, they will be prompted for permission for access to the cameras and microphones. By default, if a user declines access to the hardware, SwiftyCam will provide a prompt to the App privacy settings inside the iOS settings application.
## Miscellaneous