OCCamera icon indicating copy to clipboard operation
OCCamera copied to clipboard

dismissViewControllerAnimated does not work well

Open tarekjradi opened this issue 12 years ago • 1 comments

Hi Oliver. Its a great code.

but i need dimissing the camera when I finish the record.

i put this at delegate methods (didTakePhoto, didTakeVideo)

[self.OCViewController dismissViewControllerAnimated:YES completion:nil];

And he have a long delay to hide a camera. Why ? Have you any ideia ?

Thanks!.

tarekjradi avatar Jun 27 '13 19:06 tarekjradi

Hmm, I wonder if maybe something is blocking the main thread at that time? Are you doing any image processing before/after calling dismissViewController...? If so, I would recommend putting it on a BG dispatch queue. So something like this (pseudo-code)

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

//Work with the image

});

[self.OCViewController dismissViewControllerAnimated:YES completion:nil];

ocrickard avatar Jun 27 '13 19:06 ocrickard