I am trying to use this code to allow users to zoom and crop their images in my app: https://github.com/iosdeveloper/ImageCropper/tree/master/Classes/ImageCropper
code s
I found an answer here that helped me do what I wanted iOS: Cropping a still image grabbed from a UIImagePickerController camera with overlay
Code Snippet for those interested
float zoomScale = 1.0 / [scrollView zoomScale];
CGRect rect;
NSLog(@"contentOffset is :%f,%f",[scrollView contentOffset].x,[scrollView contentOffset].y);
rect.origin.x = fabsf([scrollView contentOffset].x * zoomScale);
rect.origin.y = fabsf([scrollView contentOffset].y * zoomScale);
rect.size.width = fabsf([scrollView bounds].size.width * zoomScale);
rect.size.height = fabsf([scrollView bounds].size.height * zoomScale);
UIGraphicsBeginImageContextWithOptions( CGSizeMake( rect.size.width,
rect.size.height),
NO,
0.);
[[imageView image] drawAtPoint:CGPointMake( -rect.origin.x, -rect.origin.y)
blendMode:kCGBlendModeCopy
alpha:1.];
UIImage *croppedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();