简体   繁体   中英

how to integrate photos library

I want to add iphone-style photo library in my app. It is like when you open Photos on iphone it shows your album lists.You can click one row and all photos are shown. Touching one, you can see the detail information of the photo and you also can scroll and zoom in/out.

Now I use UIImagePickerController , and I met problem after I selected one image. I don't know how to scroll the image and zoom in/out using apple's API. If there is no api to do this, I'd like to know how to do it.I can know the original image in


- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info

But if you want to scroll you should know all the photos in advance, and it seems UIImagePickerController doesn't provide the interface.

Can any one give tips?

thanks!

I mean after selecting one image it just like what you do in iphone's Photos, you can zoom in/out and scroll to the previous or next photo. Sorry for my ambiguous.

In order to be able to swipe through images in your library, you would have to use the ALAssetLibrary or Photos Framework (iOS 8 only) to build a custom image picker.

Here's how it should work.

  1. Use either one of these libraries to fetch the photos in the camera roll.

  2. Display the thumbnails of images in a UICollectionViewController.

  3. Display the selected image in a UIPageViewController. The data source would be the array of images that you have fetched earlier.

You need to allow the user to edit the photo.

To do that, enable the flag allowsEditing on your UIImagePickerController .

UPDATE BASED ON COMMENT: To create this functionality of browsing the photos on a carousel mode you will need to implement your own custom component. You will need to get access to the photos and then build the functionality yourself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM