title: How to open photo library from an UIAlertAction in swift?
body: <p>I'm making an app that the user can add his image to a table view list. When he gets to the view, an alert, action sheet styled, pops up asking him if he wants to take the picture, choose from the library or cancel.</p>
  
  <p>I'm having trouble with the second. I'm able to open the library with buttons using the following code:</p>
  
  <pre><code>@IBOutlet weak var imageView: UIImageView!
  
  @IBAction func loadPhoto(sender: AnyObject) {
              let pickerC = UIImagePickerController()
              pickerC.delegate = self
              self.presentViewController(pickerC, animated: true, completion: nil)
          }
  
  func imagePickerController(picker: UIImagePickerController!, didFinishPickingMediaWithInfo info: NSDictionary!) {
  
              self.dismissViewControllerAnimated(true, completion: nil);
  
              let gotImage = info[UIImagePickerControllerOriginalImage] as UIImage
              imageView.image = gotImage
  
          }
  </code></pre>
  
  <p>But when I try using this code with an UIAlertAction it doesn't work. Can someone help me, please? </p>
  
  <p>Thanks</p>