A camera view controller with custom image picker and image cropping. Written in Swift.
- Front facing and rear facing camera support
- Simple and clean look
- Custom image picker with permission checking
- Image cropping (square only)
- Flash light support
This project requires Xcode 8.3 to run and compiles with swift 3.1
Please note: This library makes use of the AVFoundation camera API's which are unavailable on the iOS simulator. You'll need a real device to run it.
ALCameraViewController is available on CocoaPods. Add the following to your Podfile:
pod 'ALCameraViewController'
To use this component couldn't be simpler.
In your viewController
let croppingEnabled = true
let cameraViewController = CameraViewController(croppingEnabled: croppingEnabled) { [weak self] image, asset in
// Do something with your image here.
// If cropping is enabled this image will be the cropped version
self?.dismissViewControllerAnimated(true, completion: nil)
}
presentViewController(cameraViewController, animated: true, completion: nil)
ALCameraViewController is available under the MIT license. See the LICENSE file for more info.