I am making a camera app. I need to test the app in the simulator but I can't access the iOS simulator camera.
If not possible in the simulator means I need to access my system camera. Whether it is possible?
I tried UIImagePickerController
but it doesn't work.
The below the code I've tried.
self.imagePicker = [[UIImagePickerController alloc] init];
UIImagePickerControllerSourceType sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
self.usingPopover = YES;
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
sourceType = UIImagePickerControllerSourceTypeCamera;
self.usingPopover = NO;
}
[self.imagePicker setSourceType:sourceType];
self.imagePicker.allowsEditing = NO;
self.imagePicker.delegate = self;
if (sourceType != UIImagePickerControllerSourceTypeCamera) {
self.popover = [[UIPopoverController alloc] initWithContentViewController:self.imagePicker];
self.popover.delegate = self;
[self.popover presentPopoverFromRect:popoverFrame inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
} else {
[self presentModalViewController:imagePicker animated:YES];
}