title: Saving UIImage with rounded corners and border with Swift
body: <p>I am using imagePickerController to pick a picture form the users library.  I need to save the picture within the app with rounded corners and a border.  When I save the image, it saves the unaltered image.  I'm assuming that I am only altering the view not the image itself.  Is there a way to save the picture as what can be seen in the view? </p>
  
  <pre><code>@IBOutlet var imageViewer: UIImageView!
  
  func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [NSObject : AnyObject]) {
      var imagePicked = info[UIImagePickerControllerOriginalImage] as UIImage
      imageViewer.layer.cornerRadius = 10.0
      imageViewer.clipsToBounds = true
      imageViewer.layer.frame = CGRectInset(imageViewer.layer.frame, 20, 20)
      imageViewer.layer.borderColor = UIColor.purpleColor().CGColor
      imageViewer.layer.borderWidth = 2.0
      imageViewer.image = imagePicked
  </code></pre>
  
  <p>Thank you for your help!</p>