So here\'s where I\'ve made it so far. I am using a UIImage captured from the camera and can crop the center square when in landscape. For some reason this doesn\'t transl
Swift 2 using UIImage Extension
extension UIImage
{
func imageByCroppingImage(size : CGSize) -> UIImage
{
let refWidth : CGFloat = CGFloat(CGImageGetWidth(self.CGImage))
let refHeight : CGFloat = CGFloat(CGImageGetHeight(self.CGImage))
let x = (refWidth - size.width) / 2
let y = (refHeight - size.height) / 2
let cropRect = CGRectMake(x, y, size.width, size.height)
let imageRef = CGImageCreateWithImageInRect(self.CGImage, cropRect)
let cropped : UIImage = UIImage(CGImage: imageRef!, scale: 0, orientation: self.imageOrientation)
return cropped
}
}