title: pass image from one view controller to another in swift
body: <p>I try to use segue to pass a image from one view controller to another, but image is null and cannot be used.</p>
  
  <p>here is the mainViewController.swift, all the logs show right value.</p>
  
  <pre><code>func imagePickerController(picker:UIImagePickerController!,didFinishPickingMediaWithInfo info: NSDictionary!){
      var i:UIImage = info.objectForKey(UIImagePickerControllerOriginalImage) as UIImage
      NSLog("%f, %f", i.size.width, i.size.height);
  
      orignal = i
      NSLog("iamge %@", orignal)
      performSegueWithIdentifier("showPhoto", sender: self)
      dismissModalViewControllerAnimated(false)
  }
  
  override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!) {
      var imageEditcontroller:ImageEditViewController = segue.destinationViewController as ImageEditViewController
  
      imageEditcontroller.editImage = orignal
      NSLog("iamge %@", imageEditcontroller.editImage)
  }
  </code></pre>
  
  <p>here is another view controller "ImageEditViewController.swift"</p>
  
  <pre><code>import UIKit
  
  class ImageEditViewController: UIViewController {
  
      @IBOutlet var imagEditView : UIImageView
  
      var editImage:UIImage=UIImage()
  
      @IBAction func doDecorateBtn(sender : AnyObject) {
          print("here text chage5")
      }
  
      @IBAction func doEmailBtn(sender : AnyObject) {
          print("here text chage6")        
      }
  
      init(coder aDecoder: NSCoder!) {
          super.init(coder: aDecoder)
          NSLog("iamge2 %@", editImage)            
      }
  
      override func viewWillAppear(animated: Bool) {
          super.viewWillAppear(animated)
          NSLog("iamge1 %@", editImage)
      }
  
      override func viewDidLoad() {
          super.viewDidLoad()
          // Do any additional setup after loading the vie
      }
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
          // Dispose of any resources that can be recreated.
      }
  }
  </code></pre>
  
  <p>So see the logs in this view controller, the var editImage are not initialized into a right value. Just new for IOS and thanks for help.</p>