I am developing an app which allows you to select photos and place them into different positions. The workflow is basically:
- Tap an area of the screen
UIImagePickerControllerdisplays- Select a photo
- Photo displays in the tapped area of the screen
I would like it so that if the user goes through this workflow for a second time, the UIImagePickerController when displayed will be showing the same album, and position within that album, that the user was last at.
I’ve tried saving a reference to the UIImagePickerController, as well as the UIPopoverController, so that they are created only once. However, every time I present the popover containing the UIImagePickerController, it is back at the main photos menu (eg. Camera Roll, Photo Library, My Photo Stream).
Any ideas for how to achieve what I’m after?
Just to point you to right direction. You can use asset library to show the images as a picker. You can use the apple sample code MyImagePicker. The method
[[assetsLibrary] enumerateGroupsWithTypes:ALAssetsGroupAlbum usingBlock:^(ALAssetsGroup *group, BOOL *stop)can be used for photo album. Using the asset library you can check which image was selected last and then use the method,You can use this method next time to enumerate which image onwards you want to enumerate. This method can accept an indexSet as
[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(index, count)]which should help to indicate the last selected image.To know more about how to use asset library check this.