/VFImageCropViewController

Primary LanguageObjective-CApache License 2.0Apache-2.0

VFImageCropViewController

  • Interactive resizable crop frame
  • Fixed or not fixed aspect rario
  • Standard aspect ratios: choose from the list
VFImageCropViewController *cropVC = [[VFImageCropViewController alloc]
                                      initWithImage:image aspectRatio:aspectRatio];
    
cropVC.cropImageActionHandler = ^(VFImageCropViewController *sender, UIImage *image, CGRect rect) {
    myImageView.image = image;
    [sender dismissViewControllerAnimated:YES completion:nil];
};
    
cropVC.cancelActionHandler = ^(VFImageCropViewController *sender) {
    [sender dismissViewControllerAnimated:YES completion:nil];
};
    
UINavigationController *navigationVC = [VFImageCropConfiguration imageCropViewControllerModalConfiguration:cropVC];
[myViewController presentViewController:navigationVC animated:YES completion:nil];

Note VFImageCropConfiguration in the example above. VFImageCropViewController is not aware about its presentation context (whether it is presented with UINavigationController, etc). Presentation details must be configured explicitly by its client.

Screenshot

Screenshot

Screenshot