I would like a moving image--live camera--to be visible as soon as a screen loads--similar to Snapchat. In Snapchat's case, the image fills the whole screen.
I would just like it to be visible in a portion of the screen in a UIView for example. Can I accomplish this with UIImagePickerView
or must I use AV Foundation?
My question is how to have the camera on in preview when the screen loads as other questions address the front vs. rear facing choice.
Right now, I have a placeholder image that if clicked launches a UIImagePickerController
. Relative to having the image on, this requires the extra step of clicking to launch the UIImagePicker Controller.
As this is is for a profile pic, ideally, the user would see an image of their face as soon as the screen loads and merely need to click to capture an image.
Can this be done with UIImagePickerController
or do you need to use AVFoundation
?
Here is my current UIImagepickerController code but it merely presents a new VC after you take an action rather than displaying a live image by default.
- (IBAction)takePhoto:(UIButton *)sender {
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentViewController:picker animated:YES completion:NULL];
}