Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 1.43 KB

README.md

File metadata and controls

31 lines (22 loc) · 1.43 KB

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