QYCustomContentView.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // QYCustomContentView.h
  3. // YSFSDK
  4. //
  5. // Created by Netease on 2018/11/27.
  6. // Copyright © 2018 Netease. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @class QYCustomModel;
  10. @protocol QYCustomContentViewDelegate;
  11. /**
  12. * 自定义消息视图基类
  13. * 使用方法:针对需自定义的消息视图,写子类继承QYCustomContentView,并实现初始化和刷新方法
  14. */
  15. @interface QYCustomContentView : UIView
  16. /**
  17. * 数据模型
  18. */
  19. @property (nonatomic, strong, readonly) QYCustomModel *model;
  20. /**
  21. * 事件代理,通过addCustomContentViewDelegate:方法设置
  22. */
  23. @property (nonatomic, weak, readonly) id<QYCustomContentViewDelegate> delegate;
  24. /**
  25. * 视图初始化方法(必须)
  26. * @discussion 一般来说,subViews在此init方法中添加
  27. * @return 视图实例
  28. */
  29. - (instancetype)initCustomContentView;
  30. /**
  31. * 刷新方法(必须)
  32. * @discussion model更新时会自动触发此方法,需重写来更新视图
  33. * @param model 数据模型
  34. */
  35. - (void)refreshData:(QYCustomModel *)model;
  36. @end