Launching photo galleries from the iphone app

Can I launch (redirect a user) my own iphone photo gallery application from my application, similar to emails? Is this possible in 4.2 sdk?

+3
source share
1 answer

To do this, you need to create and present UIImagePickerControlleras follows:

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.allowsEditing = YES;
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; 
[self presentModalViewController:imagePicker animated:YES];

You can change imagePicker.sourceTypeto imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;if you want the user to use the camera.

Delegate Method: - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)infoProvide you with an image in a dictionary info.

+6
source

Source: https://habr.com/ru/post/1776852/


All Articles