LYLPhotoTailoringTool.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //
  2. // LYLPhotoTailoringTool.h
  3. // PhotoTailoring
  4. //
  5. // Created by Rainy on 2018/8/22.
  6. // Copyright © 2018年 Rainy. All rights reserved.
  7. //
  8. #define WS(weakSelf) __weak __typeof(&*self)weakSelf = self;
  9. #import <Foundation/Foundation.h>
  10. #import <UIKit/UIKit.h>
  11. typedef void(^ShowImageBlock)(NSString *imageUrlStr);
  12. typedef void(^ChoosImageBlock)(UIImage *image);
  13. typedef enum SelectPhotoWithTypePhoroOrCamera {
  14. SelectPhotoWithTypePhoroOrCamera1 = 1, // Photo
  15. SelectPhotoWithTypePhoroOrCamera2 = 2, // Camera
  16. }SelectPhotoWithTypePhoroOrCamera;
  17. @interface LYLPhotoTailoringTool : NSObject
  18. + (instancetype)sharedTool;
  19. /**
  20. * 选择相册/拍摄
  21. */
  22. - (void)photoTailoringAndShowImg:(NSString *)imgUrl showImgBlock:(ShowImageBlock)showImgBlock choosImgBlock:(ChoosImageBlock)choosImgBlock;
  23. /**
  24. * 选择相册/拍摄 是否裁剪 上面方法默认裁剪
  25. */
  26. - (void)photoTailoringAndShowImg:(NSString *)imgUrl crop:(BOOL)crop showImgBlock:(ShowImageBlock)showImgBlock choosImgBlock:(ChoosImageBlock)choosImgBlock ;
  27. /**
  28. * 选择图片
  29. */
  30. - (void)chooseImage:(ChoosImageBlock)choosImgBlock;
  31. //已有选择器
  32. - (void)selectPhotoWithPhoroOrCamera:(SelectPhotoWithTypePhoroOrCamera)type crop:(BOOL)crop showImgBlock:(ShowImageBlock)showImgBlock choosImgBlock:(ChoosImageBlock)choosImgBlock;
  33. //直接打开相册
  34. - (void)openPhoroWithCrop:(BOOL)crop showImgBlock:(ShowImageBlock)showImgBlock choosImgBlock:(ChoosImageBlock)choosImgBlock;
  35. //直接打开相机
  36. - (void)openCameraWithCrop:(BOOL)crop showImgBlock:(ShowImageBlock)showImgBlock choosImgBlock:(ChoosImageBlock)choosImgBlock;
  37. @end