YBIBDataProtocol.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //
  2. // YBIBDataProtocol.h
  3. // YBImageBrowserDemo
  4. //
  5. // Created by 波儿菜 on 2019/6/5.
  6. // Copyright © 2019 波儿菜. All rights reserved.
  7. //
  8. #import "YBIBGetBaseInfoProtocol.h"
  9. NS_ASSUME_NONNULL_BEGIN
  10. @protocol YBIBDataProtocol <YBIBGetBaseInfoProtocol>
  11. @required
  12. /**
  13. 当前 Data 对应 Cell 的类类型
  14. @return Class 类型
  15. */
  16. - (Class)yb_classOfCell;
  17. @optional
  18. /**
  19. 获取投影视图,当前数据模型对应外界业务的 UIView (通常为 UIImageView),做转场动效用
  20. 这个方法会在做出入场动效时调用,若未实现时将无法进行平滑的入场
  21. @return 投影视图
  22. */
  23. - (__kindof UIView *)yb_projectiveView;
  24. /**
  25. 通过一系列数据,计算并返回图片视图在容器中的 frame
  26. 这个方法会在做入场动效时调用,若未实现时将无法进行平滑的入场
  27. @param containerSize 容器大小
  28. @param imageSize 图片大小 (逻辑像素)
  29. @param orientation 图片浏览器的方向
  30. @return 计算好的 frame
  31. */
  32. - (CGRect)yb_imageViewFrameWithContainerSize:(CGSize)containerSize imageSize:(CGSize)imageSize orientation:(UIDeviceOrientation)orientation;
  33. /**
  34. 预加载数据,有效的预加载能提高性能,请注意管理内存
  35. */
  36. - (void)yb_preload;
  37. /**
  38. 保存到相册
  39. */
  40. - (void)yb_saveToPhotoAlbum;
  41. /**
  42. 是否允许保存到相册
  43. */
  44. - (BOOL)yb_allowSaveToPhotoAlbum;
  45. @end
  46. NS_ASSUME_NONNULL_END