gekitz / GKImagePicker

Enables a custom crop rect for UIImagePickerController
MIT License
592 stars 176 forks source link

iOS8: Camera Freeze on Cancel #47

Open micnguyen opened 10 years ago

micnguyen commented 10 years ago

Hi,

There is an issue on iOS8 that will stall the camera when the user cancels out of the crop-area.

Repro Steps:

I suspect it may have to do with the way iOS8 handles action sheets (?), and the behaviour of dismissing the CropImageViewController. I'm currently investigating it.

Anyone bumped into this, or fixed it?

hmyap commented 9 years ago

It seems that we need to dismiss the image picker and present it again. Did you find a different solution?

micnguyen commented 9 years ago

Yep - so I have fixed the issue. I'm not sure what's going on - but it seems like in IOS8 the UIImagePickerController isn't releasing the Camera resource fast enough. It displays as being available but when you do call it, it doesn't refresh the UIImagePickerController Camera view.

So the solution to this is to dismiss the image picker and then display it again. The trick however is to display it after a certain time period - if you display it immediately, it will still show as being blank. I have found 0.5seconds to be the optimal time for it to rejig itself.

ghost commented 7 years ago

I think I am having the same issue ... when I press cancel it goes back to the camera view but is locked up. I saw from your comment that I need to dismiss and then display again but where do I do that ? I implemented the delegate method - (void)imagePickerDidCancel:(GKImagePicker )imagePicker but it never is called. I have the delegate set correctly though because if I pick from my photo roll or not cancel from the camera - (void)imagePicker:(GKImagePicker )imagePicker pickedImage:(UIImage *)image correctly. How can I determine if the user has canceled from the camera so I can then pause and re-launch ? or is there somewhere else I need to modify the code ? This is for IOS 8