DKPhotoPickerBrowserViewController.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. //
  2. // ZLPhotoPickerBrowserViewController.h
  3. // ZLAssetsPickerDemo
  4. //
  5. //
  6. #import <UIKit/UIKit.h>
  7. #import "DKPhotoPickerBrowserPhoto.h"
  8. #import "DKPhotoPickerCommon.h"
  9. #import "DKPhotoPickerCustomToolBarView.h"
  10. @class DKPhotoPickerBrowserViewController;
  11. @protocol DKPhotoPickerBrowserViewControllerDataSource <NSObject>
  12. @optional
  13. /**
  14. * 有多少组
  15. */
  16. - (NSInteger) numberOfSectionInPhotosInPickerBrowser:(DKPhotoPickerBrowserViewController *) pickerBrowser;
  17. @required
  18. /**
  19. * 每个组多少个图片
  20. */
  21. - (NSInteger) photoBrowser:(DKPhotoPickerBrowserViewController *)photoBrowser numberOfItemsInSection:(NSUInteger)section;
  22. /**
  23. * 每个对应的IndexPath展示什么内容
  24. */
  25. - (DKPhotoPickerBrowserPhoto *)photoBrowser:(DKPhotoPickerBrowserViewController *)pickerBrowser photoAtIndexPath:(NSIndexPath *)indexPath;
  26. @end
  27. @protocol DKPhotoPickerBrowserViewControllerDelegate <NSObject>
  28. @optional
  29. /**
  30. * 点击每个Item时候调用
  31. */
  32. - (void)photoBrowser:(DKPhotoPickerBrowserViewController *)pickerBrowser photoDidSelectView:(UIView *)scrollBoxView atIndexPath:(NSIndexPath *)indexPath;
  33. /**
  34. * 返回用户自定义的toolBarView(类似tableView FooterView)
  35. *
  36. * @return 返回用户自定义的toolBarView
  37. */
  38. - (DKPhotoPickerCustomToolBarView *)photoBrowserShowToolBarViewWithphotoBrowser:(DKPhotoPickerBrowserViewController *)photoBrowser;
  39. /**
  40. * 准备删除那个图片
  41. *
  42. * @param index 要删除的索引值
  43. */
  44. - (BOOL)photoBrowser:(DKPhotoPickerBrowserViewController *)photoBrowser willRemovePhotoAtIndexPath:(NSIndexPath *)indexPath;
  45. /**
  46. * 删除indexPath对应索引的图片
  47. *
  48. * @param indexPath 要删除的索引值
  49. */
  50. - (void)photoBrowser:(DKPhotoPickerBrowserViewController *)photoBrowser removePhotoAtIndexPath:(NSIndexPath *)indexPath;
  51. /**
  52. * 滑动结束的页数
  53. *
  54. * @param page 滑动的页数
  55. */
  56. - (void)photoBrowser:(DKPhotoPickerBrowserViewController *)photoBrowser didCurrentPage:(NSUInteger)page;
  57. /**
  58. * 滑动开始的页数
  59. *
  60. * @param page 滑动的页数
  61. */
  62. - (void)photoBrowser:(DKPhotoPickerBrowserViewController *)photoBrowser willCurrentPage:(NSUInteger)page;
  63. @end
  64. @interface DKPhotoPickerBrowserViewController : UIViewController
  65. // @require
  66. // 数据源/代理
  67. @property (nonatomic , weak) id<DKPhotoPickerBrowserViewControllerDataSource> dataSource;
  68. @property (nonatomic , weak) id<DKPhotoPickerBrowserViewControllerDelegate> delegate;
  69. // 点击的View
  70. @property (nonatomic , strong) UIView *toView;
  71. // 当前提供的组
  72. @property (strong,nonatomic) NSIndexPath *currentIndexPath;
  73. // @optional
  74. // 是否可以编辑(删除照片)
  75. @property (nonatomic , assign,getter=isEditing) BOOL editing;
  76. // 动画status (放大缩小/淡入淡出/旋转)
  77. @property (assign,nonatomic) UIViewAnimationAnimationStatus status;
  78. // 长按保存图片会调用sheet
  79. @property (strong,nonatomic) UIActionSheet *sheet;
  80. // 放大缩小一张图片的情况下(查看头像)
  81. - (void)showHeadPortrait:(UIImageView *)toImageView;
  82. // 放大缩小一张图片的情况下(查看头像)/ 缩略图是toImageView.image 原图URL
  83. - (void)showHeadPortrait:(UIImageView *)toImageView originUrl:(NSString *)originUrl;
  84. // 导航高度
  85. @property (assign,nonatomic) CGFloat navigationHeight;
  86. // @function
  87. // 展示控制器
  88. - (void)show;
  89. // 刷新数据
  90. - (void)reloadData;
  91. @end