How to know if iPhone camera is ready to take picture?

后端 未结 7 1923
清酒与你
清酒与你 2020-12-05 06:54

When [camera takePicture] is called before the camera is ready, it spits out this message:

UIImagePickerController: ignoring request to take pictu

7条回答
  •  执念已碎
    2020-12-05 07:45

    As per the documentation for UIImagePickerController. The takePicture() method is ready again when

    func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject]) {
    

    is called. If your interested in blocking pictures during this time period just disable the button interface (button.userInterfaceEnabled = false) until the call returns with media. I solved this very problem using the imagePickerController.

提交回复
热议问题