Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make UI Image Picker Controller read a custom source type in iPhone

I have to create a photo gallery app in iPhone. It should function same as the Photos app which is shipped with iPhone. But it should show the images which I package with the app.

UIImagePickerController reads only the following source types. UIImagePickerControllerSourceTypePhotoLibrary, UIImagePickerControllerSourceTypeCamera, UIImagePickerControllerSourceTypeSavedPhotosAlbum

I was thinking of adding the images bundle to the resources group in Xcode and make UIImagePickerController to read them and display.

Looking at the class references I found UIImagePickerController reads only from the resources mentioned above. Which means it can only pick the images from camera roll OR saved photo gallery OR allow user to take a pic and use it.

Does anybody know how to make UIImagePickerController read from custom source type or images?

OR

How to create a photo gallery app in iPhone :-)

Thanks, AJ

like image 937
AJ. Avatar asked Dec 18 '22 07:12

AJ.


2 Answers

I don't believe it is possible to make the UIImagePicker pick images from your own source. You will have to write the picker yourself (which, performance aside, doesn't seem to hard... Just a couple of UIImageViews in a UIScrollView).

like image 52
Pieter Jongsma Avatar answered Dec 27 '22 11:12

Pieter Jongsma


Just today I started a open source UIImagePickerController clone, it is not perfect but it works quite ok. Feel free to fork http://github.com/jeena/JPImagePickerController

like image 37
Jeena Avatar answered Dec 27 '22 10:12

Jeena