FWImageCropControllerDelegate
@protocol FWImageCropControllerDelegate <NSObject>
裁剪控制器事件代理协议
-
Called when the user has committed the crop action, and provides just the cropping rectangle.
Declaration
Objective-C
- (void)cropController:(nonnull FWImageCropController *)cropController didCropImageToRect:(CGRect)cropRect angle:(NSInteger)angle;
Parameters
cropRect
A rectangle indicating the crop region of the image the user chose (In the original image’s local co-ordinate space)
angle
The angle of the image when it was cropped
-
Called when the user has committed the crop action, and provides both the original image with crop co-ordinates.
Declaration
Objective-C
- (void)cropController:(nonnull FWImageCropController *)cropController didCropToImage:(nonnull UIImage *)image withRect:(CGRect)cropRect angle:(NSInteger)angle;
Parameters
image
The newly cropped image.
cropRect
A rectangle indicating the crop region of the image the user chose (In the original image’s local co-ordinate space)
angle
The angle of the image when it was cropped
-
If the cropping style is set to circular, implementing this delegate will return a circle-cropped version of the selected image, as well as it’s cropping co-ordinates
Declaration
Objective-C
- (void)cropController:(nonnull FWImageCropController *)cropController didCropToCircularImage:(nonnull UIImage *)image withRect:(CGRect)cropRect angle:(NSInteger)angle;
Parameters
image
The newly cropped image, clipped to a circle shape
cropRect
A rectangle indicating the crop region of the image the user chose (In the original image’s local co-ordinate space)
angle
The angle of the image when it was cropped
-
If implemented, when the user hits cancel, or completes a UIActivityViewController operation, this delegate will be called, giving you a chance to manually dismiss the view controller
Declaration
Objective-C
- (void)cropController:(nonnull FWImageCropController *)cropController didFinishCancelled:(BOOL)cancelled;
Parameters
cancelled
Whether a cropping action was actually performed, or if the user explicitly hit ‘Cancel’