pigeon_39
pigeon_39

Reputation: 1513

How to detect user has tapped "Use Photo" button in the camera?

When user takes a photo via devices camera, the photo appears with two button underneath itself - Retake & Use Photo. Is there any way to detect whether user has tapped the Use Photo button?

Upvotes: 0

Views: 396

Answers (2)

Gulliva
Gulliva

Reputation: 488

You have to use the delegate UIImagePickerControllerDelegate take a look at the official documentation of apple

https://developer.apple.com/reference/uikit/uiimagepickercontrollerdelegate

Implement the

func imagePickerController(_ picker: UIImagePickerController, 
      didFinishPickingMediaWithInfo info: [String : Any])

in the ViewController which calls the UIImagePickerController and set the delegate to the calling ViewController.

Upvotes: 0

Axel
Axel

Reputation: 778

after user clicks "Use Photo" delegate method didfinishPickingMediawithInfo is executed.

Upvotes: 1

Related Questions