UIImagePickerControllerCameraDeviceFront
is not a valid enum for the sourceType
property. The sourceType
property defines whether you’re using the camera or the photo library. You need to set the cameraDevice
property instead.
Objective-C
self.imgPicker.sourceType = UIImagePickerControllerSourceTypeCamera;
self.imgPicker.cameraDevice = UIImagePickerControllerCameraDeviceFront;
Swift 2
imgPicker.sourceType = .Camera
imgPicker.cameraDevice = .Front
Swift 3
imgPicker.sourceType = .camera
imgPicker.cameraDevice = .front