how to integrate photos library - ios

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.

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.

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.
Use either one of these libraries to fetch the photos in the camera roll.
Display the thumbnails of images in a UICollectionViewController.
Display the selected image
in a UIPageViewController. The data source would be the array of images that you have fetched earlier.

Related

iOS Image Viewer like Photo app

I am developing an app that has an internal gallery with some images.
What I want to achieve is exactly a result that behaves and looks like the Apple Photo app image viewer.
With a collection view I implemented the gallery images with thumbnails and now I would like to show the image on fullscreen on press.
The image viewer should have exactly the Apple's Photo behavior:
Full screen on single tap,
Delete, Share button etc...
Pinch to zoom, double tap zoom...
My question is. Is that really possible that such a common feature is not already given by iOS? Is there maybe a view controller already build in that we can use but I am not aware of?
I know there are some libraries around that make such thing, but I'm wondering if there's already something given.

How to open Saved Photos Album when touch a button? [duplicate]

I am trying to write an app which involves picking a picture from either camera or library. Once the picture is picked , I want to show the preview of the picture.It happens by default when camera is opted. Once the photo is clicked, it shows the user to choose or retake. But I want the same to be done when the picture is selected from the photo library also. Can this be done??
Ok thanks for the response. Here is what I did:
Subclass UIImagePickerController . Upon picking an image, I am pushing another viewcontroller which is similiar to preview screen. This is similiar to facebook app and so I think it will get approved by apple.
I may be wrong, but I think you need to implement the custom view yourself. You can use the delegate callback method to get the selected image and put it on your custom view along with buttons (choose or retake).

iOS didFinishPickingMediaWithInfo camera roll order newest Images at top

A quick question how do you reverse the order that the camera roll is shown i.e newest images at the top rather than having to scroll all the way to the bottom to get newest image? Alas Facebook image picker?
This works for me in the sense that its just one extra step to select album then images are presented latest first UIImagePickerControllerSourceTypePhotoLibrary rather than UIImagePickerControllerSourceTypeSavedPhotosAlbum
There is one more solution to this
-Using AssetsLibrary frmaework you can have the view completely customised as per your requirement.
Reference :
UIImagepickercontroller: is it possible to change the sort order of the images in camera roll?

Creating my own Image Picker

I'd like to create a custom image browser in my app that uses the images from the camera roll.
i.e. I'd like to completely replace UIImagePickerController and use my own control.
Is there a way of accessing the camera roll photos in this way?
Cluster App does this but I can't find a picture of it.
You need to use ALAssetsLibrary to access the images.
Have a look at the QBImagePickerController on the GitHub. They implemented custom image picker controller very similar to UIImagePickerController with added multiple selection feature. It will help you. Atleast look at this file
Check out RengarViewController
a custom image picker controller which make use of Photo Framework (introduced in iOS 8).
It has nice UI, can be scrolled and panned.

Is there a photo display control available for ipad?

Like a photo gallery control, where you can load and display pictures in thumbnails, and then tap on them, and see full image, zoom in/out?
The three20 library has a photo viewer that mimics the iPhone's photo viewer:
http://github.com/facebook/three20
Specifically the TTPhotoViewController class.
Since nobody replied, gonna give my answer, which is no. There is no such control available as of today unfortunately. Also the photos app slider is nice, would like to see some more controls like that.

Resources