title: How do I create a camera app that takes multiple photos swift
body: <p>I am trying to create an app that takes more than a single photo. What I want is every time​ I take a photo I want the camera opens right after the first photo.</p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate {
  
      @IBOutlet var myImage: UIImageView!
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
      }
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
      }
      @IBAction func takePhoto(_ sender: Any) {
          if UIImagePickerController.isSourceTypeAvailable(UIImagePickerController.SourceType.camera) {
              let imagePicker = UIImagePickerController()
              imagePicker.delegate = self
              imagePicker.sourceType = UIImagePickerController.SourceType.camera
              imagePicker.allowsEditing = false
              self.present(imagePicker, animated: true, completion: nil)
          }
      }
  
      func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
          if let pickedImage = info[UIImagePickerController.InfoKey.originalImage] as? UIImage {
              myImage.contentMode = .scaleToFill
              myImage.image = pickedImage
          }
          picker.dismiss(animated: true, completion: nil)
      }
  
  }
  </code></pre>