HUPhotoBrowser.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //
  2. // HUPhotoBrowser.h
  3. // HUPhotoBrowser
  4. //
  5. // Created by mac on 16/2/24.
  6. // Copyright (c) 2016年 hujewelz. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. typedef void(^ __nullable DismissBlock)(UIImage * __nullable image, NSInteger index);
  10. typedef NS_ENUM(NSInteger, HUPhotoBrowserType) {
  11. NormalType,
  12. SpecialType,
  13. Type333333,//只有删除
  14. Type44444
  15. };
  16. @protocol HUPhotoBrowserDelegate <NSObject>
  17. - (void)setImageForSelfAvatar:(UIImage *)image;
  18. - (void)didDeletePhotoInIndex:(NSInteger)index;//已经删除了下标为多少的图片
  19. - (void)SetToTheHomePageImage:(NSInteger)index;//设置为首页形象照
  20. @end
  21. @interface HUPhotoBrowser : UIView
  22. @property (nonatomic,weak)id <HUPhotoBrowserDelegate>delegate;
  23. @property (nonatomic,assign)HUPhotoBrowserType type;
  24. /*
  25. * @param imageView 点击的imageView
  26. * @param URLStrings 加载的网络图片的urlString
  27. * @param index 点击的图片在所有要展示图片中的位置
  28. */
  29. + (nonnull instancetype)showFromImageView:(nullable UIImageView *)imageView withURLStrings:(nullable NSArray *)URLStrings atIndex:(NSInteger)index;
  30. + (nonnull instancetype)showFromImageView:(nullable UIImageView *)imageView withURLStrings:(nullable NSArray *)URLStrings placeholderUrlStrings:(nullable NSArray *)holderURLStrings atIndex:(NSInteger)index;
  31. /*
  32. * @param imageView 点击的imageView
  33. * @param withImages 加载的本地图片
  34. * @param index 点击的图片在所有要展示图片中的位置
  35. */
  36. + (nonnull instancetype)showFromImageView:(nullable UIImageView *)imageView withImages:(nullable NSArray *)images atIndex:(NSInteger)index;
  37. /*
  38. * @param imageView 点击的imageView
  39. * @param URLStrings 加载的网络图片的urlString
  40. * @param image 占位图片
  41. * @param index 点击的图片在所有要展示图片中的位置
  42. * @param dismiss photoBrowser消失的回调
  43. */
  44. + (nonnull instancetype)showFromImageView:(nullable UIImageView *)imageView withURLStrings:(nullable NSArray *)URLStrings placeholderImage:(nullable UIImage *)image atIndex:(NSInteger)index dismiss:(DismissBlock)block;
  45. /*
  46. * @param imageView 点击的imageView
  47. * @param withImages 加载的本地图片
  48. * @param image 占位图片
  49. * @param index 点击的图片在所有要展示图片中的位置
  50. * @param dismiss photoBrowser消失的回调
  51. */
  52. + (nonnull instancetype)showFromImageView:(nullable UIImageView *)imageView withImages:(nullable NSArray *)images atIndex:(NSInteger)index dismiss:(DismissBlock)block;
  53. + (nonnull instancetype)Type444showFromImageView:(nullable UIImageView *)imageView withImages:(nullable NSArray *)images atIndex:(NSInteger)index;
  54. + (nonnull instancetype)Type444showFromImageView:(nullable UIImageView *)imageView withImages:(nullable NSArray *)images atIndex:(NSInteger)index dismiss:(DismissBlock)block;
  55. @property (nonatomic, strong, nullable) UIImage *placeholderImage;
  56. @property (nonatomic,strong) NSArray* placeHolderUrlStrings;
  57. @end