Swift 4, Is there a way to capture photo with good quality without using capturePhoto?

241 Views Asked by At

I know that AvcaptureSession.Preset.Photo has a size of video output of 750/1000 and has a size of photo output of 3024 / 4034 Is there a way to capture the photo output without using capturePhoto?

I tried to capture from "didoutput" but this is a video output so I get the size of 750/1000.

Help me please..

1

There are 1 best solutions below

0
On

You can use a UIImagePickerController with sourceType.camera. This opens a pre built camera from apple with which you are able to take pictures. This would be the function:

func camera() {
    if UIImagePickerController.isSourceTypeAvailable(.camera) {
        let myCameraController = UIImagePickerController()
        myCameraController.delegate = self
        myCameraController.sourceType = .camera
        self.present(myCameraController, animated: true, completion: nil)
    }
}

To use UIImagePickerController you have to set UIImagePickerControllerDelegate and UINavigationControllerDelegate in your class and call this function in ViewDidLoad Hope that this solved your problem