WBStatusCell.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. //
  2. // WBFeedCell.h
  3. // YYKitExample
  4. //
  5. // Created by ibireme on 15/9/5.
  6. // Copyright (c) 2015 ibireme. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "YYKit.h"
  10. #import "WBStatusLayout.h"
  11. #import "YYTableViewCell.h"
  12. @class WBStatusCell;
  13. @protocol WBStatusCellDelegate;
  14. @interface WBStatusTitleView : UIView
  15. @property (nonatomic, strong) YYLabel *titleLabel;
  16. @property (nonatomic, strong) UIButton *arrowButton;
  17. @property (nonatomic, weak) WBStatusCell *cell;
  18. @end
  19. @interface WBStatusProfileView : UIView
  20. @property (nonatomic, strong) UIImageView *avatarView; ///< 头像
  21. @property (nonatomic, strong) UIImageView *avatarBadgeView; ///< 徽章
  22. @property (nonatomic, strong) YYLabel *nameLabel;
  23. @property (nonatomic, strong) YYLabel *sourceLabel;
  24. @property (nonatomic, strong) UIImageView *backgroundImageView;
  25. @property (nonatomic, strong) UIButton *arrowButton;
  26. @property (nonatomic, strong) UIButton *followButton;
  27. @property (nonatomic, assign) WBUserVerifyType verifyType;
  28. @property (nonatomic, weak) WBStatusCell *cell;
  29. @end
  30. @interface WBStatusCardView : UIView
  31. @property (nonatomic, strong) UIImageView *imageView;
  32. @property (nonatomic, strong) UIImageView *badgeImageView;
  33. @property (nonatomic, strong) YYLabel *label;
  34. @property (nonatomic, strong) UIButton *button;
  35. @property (nonatomic, weak) WBStatusCell *cell;
  36. @end
  37. @interface WBStatusToolbarView : UIView
  38. @property (nonatomic, strong) UIButton *repostButton;
  39. @property (nonatomic, strong) UIButton *commentButton;
  40. @property (nonatomic, strong) UIButton *likeButton;
  41. @property (nonatomic, strong) UIImageView *repostImageView;
  42. @property (nonatomic, strong) UIImageView *commentImageView;
  43. @property (nonatomic, strong) UIImageView *likeImageView;
  44. @property (nonatomic, strong) YYLabel *repostLabel;
  45. @property (nonatomic, strong) YYLabel *commentLabel;
  46. @property (nonatomic, strong) YYLabel *likeLabel;
  47. @property (nonatomic, strong) CAGradientLayer *line1;
  48. @property (nonatomic, strong) CAGradientLayer *line2;
  49. @property (nonatomic, strong) CALayer *topLine;
  50. @property (nonatomic, strong) CALayer *bottomLine;
  51. @property (nonatomic, weak) WBStatusCell *cell;
  52. - (void)setWithLayout:(WBStatusLayout *)layout;
  53. // set both "liked" and "likeCount"
  54. - (void)setLiked:(BOOL)liked withAnimation:(BOOL)animation;
  55. @end
  56. @interface WBStatusTagView : UIView
  57. @property (nonatomic, strong) UIImageView *imageView;
  58. @property (nonatomic, strong) YYLabel *label;
  59. @property (nonatomic, strong) UIButton *button;
  60. @property (nonatomic, weak) WBStatusCell *cell;
  61. @end
  62. @interface WBStatusView : UIView
  63. @property (nonatomic, strong) UIView *contentView; // 容器
  64. @property (nonatomic, strong) WBStatusTitleView *titleView; // 标题栏
  65. @property (nonatomic, strong) WBStatusProfileView *profileView; // 用户资料
  66. @property (nonatomic, strong) YYLabel *textLabel; // 文本
  67. @property (nonatomic, strong) NSArray<UIView *> *picViews; // 图片
  68. @property (nonatomic, strong) UIView *retweetBackgroundView; //转发容器
  69. @property (nonatomic, strong) YYLabel *retweetTextLabel; // 转发文本
  70. @property (nonatomic, strong) WBStatusCardView *cardView; // 卡片
  71. @property (nonatomic, strong) WBStatusTagView *tagView; // 下方Tag
  72. @property (nonatomic, strong) WBStatusToolbarView *toolbarView; // 工具栏
  73. @property (nonatomic, strong) UIImageView *vipBackgroundView; // VIP 自定义背景
  74. @property (nonatomic, strong) UIButton *menuButton; // 菜单按钮
  75. @property (nonatomic, strong) UIButton *followButton; // 关注按钮
  76. @property (nonatomic, strong) WBStatusLayout *layout;
  77. @property (nonatomic, weak) WBStatusCell *cell;
  78. @end
  79. @protocol WBStatusCellDelegate;
  80. @interface WBStatusCell : YYTableViewCell
  81. @property (nonatomic, weak) id<WBStatusCellDelegate> delegate;
  82. @property (nonatomic, strong) WBStatusView *statusView;
  83. - (void)setLayout:(WBStatusLayout *)layout;
  84. @end
  85. @protocol WBStatusCellDelegate <NSObject>
  86. @optional
  87. /// 点击了 Cell
  88. - (void)cellDidClick:(WBStatusCell *)cell;
  89. /// 点击了 Card
  90. - (void)cellDidClickCard:(WBStatusCell *)cell;
  91. /// 点击了转发内容
  92. - (void)cellDidClickRetweet:(WBStatusCell *)cell;
  93. /// 点击了Cell菜单
  94. - (void)cellDidClickMenu:(WBStatusCell *)cell;
  95. /// 点击了关注
  96. - (void)cellDidClickFollow:(WBStatusCell *)cell;
  97. /// 点击了转发
  98. - (void)cellDidClickRepost:(WBStatusCell *)cell;
  99. /// 点击了下方 Tag
  100. - (void)cellDidClickTag:(WBStatusCell *)cell;
  101. /// 点击了评论
  102. - (void)cellDidClickComment:(WBStatusCell *)cell;
  103. /// 点击了赞
  104. - (void)cellDidClickLike:(WBStatusCell *)cell;
  105. /// 点击了用户
  106. - (void)cell:(WBStatusCell *)cell didClickUser:(WBUser *)user;
  107. /// 点击了图片
  108. - (void)cell:(WBStatusCell *)cell didClickImageAtIndex:(NSUInteger)index;
  109. /// 点击了 Label 的链接
  110. - (void)cell:(WBStatusCell *)cell didClickInLabel:(YYLabel *)label textRange:(NSRange)textRange;
  111. @end