0

I am trying to have my application take a photo of an "intruder" when the wrong pin is entered into my application.

I have set up the UIImagePickerController(Below) and can make the application display the camera and take photos with no problem what so ever.

picker = UIImagePickerController() //make a clean controller
picker.delegate = self
picker.allowsEditing = false
picker.sourceType = UIImagePickerControllerSourceType.Camera
picker.cameraCaptureMode = .Photo
presentViewController(picker,animated: true,completion: nil)

Then i proceed to attempt this as to make the new set up for the picker

picker.showsCameraControls = false

I know that has to be set to false to call picker.takePicture()

Now I dont want to present the picker viewController and be able to call takePicture() but this is not hitting the delegate method of didFinishPickingMediaWithInfo.

I have tried using a custom overlay as well, but to no avail of 100% hiding the camera.

How do I go about not showing or displaying the camera on screen and being able to grab this picture of the front camera?

I have permission for access as well.

The other question posted on here of a similar topic does not solve this issue for help in swift.

Is the only way possible using AVFoundation? If so, any help would be appreciated

A. Petrizza
  • 3,202
  • 2
  • 15
  • 24

0 Answers0