XG_AssetPickerController.h 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. //
  2. // XG_AssetPickerController.h
  3. // MyApp
  4. //
  5. // Created by huxinguang on 2018/9/26.
  6. // Copyright © 2018年 huxinguang. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "XG_RootViewController.h"
  10. #import "XG_PickerMacro.h"
  11. #import "XG_AssetPickerManager.h"
  12. #import "XG_AssetModel.h"
  13. #define kItemMargin 3 //item间距
  14. #define kItemsAtEachLine 4 //每行显示多少个
  15. #define kBottomConfirmBtnHeight 49 //底部确定按钮的高度
  16. #define kBottomConfirmBtnTitleFontSize 16 //确定按钮字体大小
  17. #define kAlbumTableViewMarginTopBottom 10 //相册列表上下边距
  18. #define kAlbumTableViewRowHeight 60+15 //相册列表cell高度
  19. #define kContainerViewMaxHeight (kAppScreenHeight-kAppStatusBarAndNavigationBarHeight-kBottomConfirmBtnHeight)/2 //相册列表最大高度
  20. #define kTitleViewTextImageDistance 0 //标题和三角形距离
  21. #define kTitleViewArrowSize CGSizeMake(12.0, 7.0) //三角图片大小
  22. #define kTitleViewTitleFont [UIFont boldSystemFontOfSize:16] //标题字体大小
  23. @class XG_AlbumModel;
  24. @class NavTitleView;
  25. @class XG_AssetModel;
  26. @protocol XG_AssetPickerControllerDelegate;
  27. @class XG_AssetPickerOptions;
  28. @interface XG_AssetPickerController : XG_RootViewController
  29. @property (nonatomic, weak) id<XG_AssetPickerControllerDelegate> delegate;
  30. @property (nonatomic, strong) XG_AssetPickerOptions *pickerOptions;
  31. + (instancetype)new UNAVAILABLE_ATTRIBUTE;
  32. - (instancetype)init UNAVAILABLE_ATTRIBUTE;
  33. - (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil UNAVAILABLE_ATTRIBUTE;
  34. - (instancetype)initWithCoder:(NSCoder *)aDecoder UNAVAILABLE_ATTRIBUTE;
  35. - (instancetype)initWithOptions:(XG_AssetPickerOptions *)options delegate:(id<XG_AssetPickerControllerDelegate>)delegate;
  36. @end
  37. @protocol XG_AssetPickerControllerDelegate <NSObject>
  38. @required
  39. - (void)assetPickerController:(XG_AssetPickerController *)picker didFinishPickingAssets:(NSArray<XG_AssetModel *> *)assets;
  40. @optional
  41. - (void)assetPickerControllerDidCancel:(XG_AssetPickerController *)picker;
  42. @end
  43. @interface XG_AssetPickerOptions: NSObject
  44. @property (nonatomic, assign) NSInteger maxAssetsCount; //最大可选数量
  45. @property (nonatomic, assign) BOOL videoPickable; //是否可选视频
  46. @property (nonatomic, strong) NSMutableArray<XG_AssetModel *> *pickedAssetModels; //已选asset
  47. @end
  48. @interface NavTitleView : UIView
  49. @property (nonatomic, strong) UIButton *titleBtn;
  50. @property (nonatomic, strong) UIImageView *arrowView;
  51. @property (strong, nonatomic) XG_BarButton *leftBarButton;
  52. @property (strong, nonatomic) XG_BarButton *rightBarButton;
  53. @property (nonatomic, strong) void (^blockLeft)(void);
  54. @property (nonatomic, strong) void (^blockRight)(void);
  55. - (void)resetViewWithStr:(NSString *)str;
  56. @end