Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]){
- UIImagePickerController *picker = [[UIImagePickerController alloc] init];
- picker.delegate = self;
- picker.allowsEditing = YES;
- picker.sourceType = UIImagePickerControllerSourceTypeCamera;
- [self presentViewController:picker animated:YES completion:NULL];
- }
- else{
- UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Camera Unavailable"
- message:@"Unable to find a camera on your device."
- delegate:nil
- cancelButtonTitle:@"OK"
- otherButtonTitles:nil, nil];
- [alert show];
- alert = nil;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement