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
There is the swift version for the checked solution :
private func imageByCroppingImage(image : UIImage, size : CGSize) -> UIImage{
var refWidth : CGFloat = CGFloat(CGImageGetWidth(image.CGImage))
var refHeight : CGFloat = CGFloat(CGImageGetHeight(image.CGImage))
var x = (refWidth - size.width) / 2
var y = (refHeight - size.height) / 2
let cropRect = CGRectMake(x, y, size.height, size.width)
let imageRef = CGImageCreateWithImageInRect(image.CGImage, cropRect)
let cropped : UIImage = UIImage(CGImage: imageRef, scale: 0, orientation: image.imageOrientation)!
return cropped
}