title: How do i do segue after i finish picked an image from a gallery or camera?
body: <p>How do i do a segue to another controller after i have done choosing a picture from a gallery or taking a picture from a camera phone?</p>
  
  <p>Currently my <strong>postChoices</strong> view has 2 buttons that will take a user to a gallery or take a photo. I've done a segue in the storyboard if the user clicked the button it will bring it to the next view which is <strong>postView</strong></p>
  
  <p>but it doesn't work, it keeps going to the same view.</p>
  
  <p>Here's the code</p>
  
  <pre><code>import UIKit
  
  class postChoices: UIViewController, UIImagePickerControllerDelegate {
  
  
      @IBAction func gallery(sender: AnyObject) {
  
          var image = UIImagePickerController()
          //image.delegate = self
          image.sourceType = UIImagePickerControllerSourceType.PhotoLibrary
          image.allowsEditing = false
  
          self.presentViewController(image, animated: true, completion: nil)
  
  
      }
      override func viewDidLoad() {
          super.viewDidLoad()
          self.performSegueWithIdentifier("gall", sender: self)
  
              // Do any additional setup after loading the view.
      }
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
          // Dispose of any resources that can be recreated.
      }
  
      func imagePickerController(picker: UIImagePickerController, didFinishPickingImage image: UIImage!, editingInfo: [NSObject : AnyObject]!) {
          println("Image selected")
          self.dismissViewControllerAnimated(true, completion: nil)
              }
  
  
  }
  </code></pre>
  
  <p>Edited version, i added the storyBoard</p>
  
  <p><img src="https://i.stack.imgur.com/atmju.png" alt="enter image description here"></p>