IModelCell.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /************************************************************
  2. * * Hyphenate CONFIDENTIAL
  3. * __________________
  4. * Copyright (C) 2016 Hyphenate Inc. All rights reserved.
  5. *
  6. * NOTICE: All information contained herein is, and remains
  7. * the property of Hyphenate Inc.
  8. * Dissemination of this information or reproduction of this material
  9. * is strictly forbidden unless prior written permission is obtained
  10. * from Hyphenate Inc.
  11. */
  12. #import <Foundation/Foundation.h>
  13. /** @brief 消息cell的协议 */
  14. @protocol IModelCell <NSObject>
  15. @required
  16. /** @brief 消息对象 */
  17. @property (strong, nonatomic) id model;
  18. /*!
  19. @method
  20. @brief 获取cell的reuseIdentifier
  21. @param model 消息对象模型
  22. @return reuseIdentifier
  23. */
  24. + (NSString *)cellIdentifierWithModel:(id)model;
  25. /*!
  26. @method
  27. @brief 获取cell的高度
  28. @param model 消息对象模型
  29. @return cell的高度
  30. */
  31. + (CGFloat)cellHeightWithModel:(id)model;
  32. @optional
  33. /*!
  34. @method
  35. @brief 初始化消息cell
  36. @param style cell的样式
  37. @param reuseIdentifier cell的重用标识符
  38. @param model 消息对象
  39. @return UITableViewCell
  40. */
  41. - (instancetype)initWithStyle:(UITableViewCellStyle)style
  42. reuseIdentifier:(NSString *)reuseIdentifier
  43. model:(id)model;
  44. @end