1

I am building a camera app and would like to have the last taken photo show up as a button to choose a photo. How would I do that?

Right now I am using UIImagePickerController to choose the image, and UIButton with just text to bring up the controller.

@IBAction func choosePhotoBtnPressed(_ sender: Any) {
    let imagePicker = UIImagePickerController()
    imagePicker.sourceType = .photoLibrary
    imagePicker.mediaTypes = [kUTTypeImage as String, kUTTypeMovie as String]
    imagePicker.delegate = self
    present(imagePicker, animated: true, completion: nil)
}

I want it to look like the stock camera app.

https://i1.wp.com/9to5mac.com/wp-content/uploads/sites/6/2013/09/screen-shot-2013-09-20-at-9-56-50-am.png?resize=1600%2C1000&quality=82&strip=all

Mason
  • 33
  • 5
  • Please explain more what you want to say – Gourav Joshi Feb 21 '19 at 10:33
  • @GouravJoshi I would like to know how to create a button that gets the last taken photo from a users camera roll and set that image to the button image. Just like the stock app on the iPhone. – Mason Feb 26 '19 at 00:10

0 Answers0