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

送分小仙女□ 提交于 2019-12-11 06:57:24

问题


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?


回答1:


You should

1) subclass UIImagePickerController

2) set showCameraControls = NO

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




回答2:


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.



来源:https://stackoverflow.com/questions/19241576/how-to-know-i-tap-taking-photo-button-with-uiimagepicker

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!