How do I allow an iPhone user to "Move and Scale" a photo that has already been selected
I am trying to replicate the functionality that users see when they go into edit mode for a contact for which they have already selected a photo, and then click that contact's photo. An action sheet slides up, with options including "Take Photo", "Choose Photo", and "Edit Photo". When you select "Edit Photo", a view comes up that shows the previously selected photo, with "Move and Scale" on top of it, and Cancel and Choose buttons at the bottom. How do I show this "Move and Scale" view for any give UIImage?
To make it clear - I already have "Take Photo" and "Choose Photo" working. And I understand how to use the UIImagePickerController with allowsEditing=YES. I am talking about the situation where the user has already chosen a photo, and later (perhaps days or weeks later) decides they want to edit that photo. In that case, I want to bring up the "Move and Scale" view, just as can be done in Contacts.
Is there a hidden way to use the UIImagePickerController to do this? Or some other built-in method? Or would I need to build this view myself? If I need to build it myself,开发者_如何学C any pointers?
Thanks!
There is no set way to do this. You would have to roll your own. Theres entire apps dedicated to custom image editing as their sole purpose, so it can be done, but no prebuilt way to get to the image picker editing screen that allowsEditing = YES; gets you.
You could use the new Assets Library API to save the image to the photo library and then fire up UIImagePicker and direct the user to go choose the image in question and to gol-darnit edit it this time... But that's pretty ugly.
精彩评论