UIImagePickerController(FWImagePickerPluginImpl)
@interface UIImagePickerController (FWImagePickerPluginImpl)
/**
快速创建单选照片选择器(仅图片),自动设置delegate
@param sourceType 选择器类型
@param allowsEditing 是否允许编辑
@param completion 完成回调。参数1为图片,2为信息字典,3为是否取消
@return 照片选择器,不支持的返回nil
*/
+ (nullable UIImagePickerController *)fw_pickerControllerWithSourceType:(UIImagePickerControllerSourceType)sourceType
allowsEditing:(BOOL)allowsEditing
completion:(void (^)(UIImage * _Nullable image, NSDictionary * _Nullable info, BOOL cancel))completion NS_REFINED_FOR_SWIFT;
/**
快速创建单选照片选择器,可自定义dismiss流程,自动设置delegate
@param sourceType 选择器类型
@param filterType 过滤类型,默认0同系统
@param allowsEditing 是否允许编辑
@param shouldDismiss 是否先关闭照片选择器再回调,如果先关闭则回调参数1为nil
@param completion 完成回调。参数1为照片选择器,2为对象(UIImage|PHLivePhoto|NSURL),3为信息字典,4为是否取消
@return 照片选择器,不支持的返回nil
*/
+ (nullable UIImagePickerController *)fw_pickerControllerWithSourceType:(UIImagePickerControllerSourceType)sourceType
filterType:(FWImagePickerFilterType)filterType
allowsEditing:(BOOL)allowsEditing
shouldDismiss:(BOOL)shouldDismiss
completion:(void (^)(UIImagePickerController * _Nullable picker, id _Nullable object, NSDictionary * _Nullable info, BOOL cancel))completion NS_REFINED_FOR_SWIFT;
/**
快速创建单选照片选择器,使用自定义裁剪控制器编辑
@param sourceType 选择器类型
@param cropController 自定义裁剪控制器句柄,nil时自动创建默认裁剪控制器
@param completion 完成回调。参数1为图片,2为信息字典,3为是否取消
@return 照片选择器,不支持的返回nil
*/
+ (nullable UIImagePickerController *)fw_pickerControllerWithSourceType:(UIImagePickerControllerSourceType)sourceType
cropController:(nullable FWImageCropController * (^)(UIImage *image))cropController
completion:(void (^)(UIImage * _Nullable image, NSDictionary * _Nullable info, BOOL cancel))completion NS_REFINED_FOR_SWIFT;
@end
Undocumented
-
快速创建单选照片选择器(仅图片),自动设置delegate
Declaration
Objective-C
+ (nullable UIImagePickerController *) fw_pickerControllerWithSourceType: (UIImagePickerControllerSourceType)sourceType allowsEditing:(BOOL)allowsEditing completion:(nonnull void (^)( UIImage *_Nullable __strong, NSDictionary *_Nullable __strong, BOOL))completion;
Parameters
sourceType
选择器类型
allowsEditing
是否允许编辑
completion
完成回调。参数1为图片,2为信息字典,3为是否取消
Return Value
照片选择器,不支持的返回nil
-
快速创建单选照片选择器,可自定义dismiss流程,自动设置delegate
Declaration
Objective-C
+ (nullable UIImagePickerController *) fw_pickerControllerWithSourceType: (UIImagePickerControllerSourceType)sourceType filterType:(FWImagePickerFilterType)filterType allowsEditing:(BOOL)allowsEditing shouldDismiss:(BOOL)shouldDismiss completion: (nonnull void (^)( UIImagePickerController *_Nullable __strong, id _Nullable __strong, NSDictionary *_Nullable __strong, BOOL))completion;
Parameters
sourceType
选择器类型
filterType
过滤类型,默认0同系统
allowsEditing
是否允许编辑
shouldDismiss
是否先关闭照片选择器再回调,如果先关闭则回调参数1为nil
completion
完成回调。参数1为照片选择器,2为对象(UIImage|PHLivePhoto|NSURL),3为信息字典,4为是否取消
Return Value
照片选择器,不支持的返回nil
-
快速创建单选照片选择器,使用自定义裁剪控制器编辑
Declaration
Objective-C
+ (nullable UIImagePickerController *) fw_pickerControllerWithSourceType: (UIImagePickerControllerSourceType)sourceType cropController: (nullable FWImageCropController *_Nonnull (^)( UIImage *_Nonnull __strong))cropController completion:(nonnull void (^)( UIImage *_Nullable __strong, NSDictionary *_Nullable __strong, BOOL))completion;
Parameters
sourceType
选择器类型
cropController
自定义裁剪控制器句柄,nil时自动创建默认裁剪控制器
completion
完成回调。参数1为图片,2为信息字典,3为是否取消
Return Value
照片选择器,不支持的返回nil