title: How to resize photo with UIImagePicker / Swift
body: <p>I am having trouble resizing a photo after the camera takes the photo in swift.  Currently I have an Image View in my scene that is 100 x 100 (for a profile photo) but when I run the app, the photo never shows up after I use the camera.  Here is my code. What I am missing:</p>
  
  <pre><code>@IBAction func employeePhotoButton(sender: AnyObject) {
  
      if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.Camera) {
          var imagePicker = UIImagePickerController()
          imagePicker.delegate = self
          imagePicker.sourceType = UIImagePickerControllerSourceType.Camera;
          imagePicker.allowsEditing = false
          self.presentViewController(imagePicker, animated: true, completion: nil)
  
          func resizeImage(image: UIImage, newWidth: CGFloat) -&gt; UIImage {
  
              let scale = newWidth / image.size.width
              let newHeight = image.size.height * scale
              UIGraphicsBeginImageContext(CGSizeMake(newWidth, newHeight))
              image.drawInRect(CGRectMake(0, 0, newWidth, newHeight))
              let newImage = UIGraphicsGetImageFromCurrentImageContext()
              UIGraphicsEndImageContext()
  
              return newImage
          }
  
          func imagePickerController(picker: UIImagePickerController, didFinishPickingImage image: UIImage!, editingInfo: [NSObject : AnyObject]!) {
  
              employeePhoto.image = resizeImage(image!, newWidth: 100)
  
              self.dismissViewControllerAnimated(true, completion: nil);
          }
  
  
      }
  }
  </code></pre>