How to know I tap “taking photo button” with UIIma

2019-08-05 04:26发布

There are three delegate method with UIImagePickerDelegate.

(void)imagePickerController:(UIImagePickerController *)picker 
didFinishPickingMediaWithInfo:(NSDictionary *)info;

This method tell you the piture you take. But when I tap the "taking photo button", how I know the event?

2条回答
我只想做你的唯一
2楼-- · 2019-08-05 04:49

You should

1) subclass UIImagePickerController

2) set showCameraControls = NO

3) create your own controls on this ViewController's view

查看更多
Viruses.
3楼-- · 2019-08-05 04:52

Xcode 7.3, iOS 9.3

My way is a bit hacky, but essentially I drill down the view hierarchy to find CMKShutterButton, then attach a method to the the appropriate control event.

See my post and solution here: iOS, UIImagePickerController, is there a way to detect when user taps the take picture button without implementing custom controls? and https://stackoverflow.com/a/36489246/4018041.

Hope this helps! Cheers.

查看更多
登录 后发表回答