This class presents a camera for capturing still images and returning them to the presenting view controller through a callback to the delegate. Unlike many other camera controllers, this one does not provide the functionality for presenting a new view for accepting and cropping the captured image. It leaves that feature for the application to support providing more flexibility and customization by the application.
To run the example project, clone the repo, and run pod install
from the Example directory first.
Import the class.
import MMSCameraViewController
To present the camera, instantiate the controller object, assign the delegate, and present the view controller:
@IBAction func openCamera(_ sender: AnyObject) {
let camera = MMSCameraViewController(nibName: nil, bundle: nil)
camera.delegate = self
present(camera, animated: true, completion: nil)
}
To acquire the image, implement the delegate:
func cameraDidCaptureStillImage(_ image: UIImage, camera:MMSCameraViewController) {
imageView.image = image
camera.dismiss(animated: true, completion: nil)
}
To run the example project, clone the repo, and run pod install
from the Example directory first.
MMSProfileImagePicker requires iOS 8.3 or later.
MMSCameraViewController is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "MMSCameraViewController"
William Miller, support@millermobilesoft.com
MMSCameraViewController is available under the MIT license. See the LICENSE file for more info.