2017-12-18 167 views
-1

瞭解iPhone有自動設置定時拍照功能,自動拍攝照片。之後按下快門按鈕啓動。如何通過操縱快門按鈕

我想要做類似的事情。所以如何在相機啓動後以編程方式處理快門按鈕。

- implement: UINavigationControllerDelegate, UIImagePickerControllerDelegate 

class ViewController: UIViewController, UINavigationControllerDelegate, UIImagePickerControllerDelegate { 

var imagePicker: UIImagePickerController! 


} 

//-- launch the camera 

    @IBAction func takePhoto(_ sender: UIButton) { 

     imagePicker = UIImagePickerController() 
     imagePicker.delegate = self 
     imagePicker.sourceType = .camera 
     present(imagePicker, animated: true, completion: nil) 
    } 

所以,相機推出後,如何通過編程處理的快門按鈕類似點擊它來拍照?

回答

0

因此,相機啓動後,如何以編程方式處理快門按鈕,如點擊它來拍照?

告訴UIImagePickerController到takePicture

+0

凡來實現這個?按鈕功能裏面?請告訴我這是如何完成的?謝謝 – MilkBottle