HomeLiveCourseView.m 941 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // HomeLiveCourseView.m
  3. // KulexiuForStudent
  4. //
  5. // Created by 王智 on 2022/5/26.
  6. //
  7. #import "HomeLiveCourseView.h"
  8. @interface HomeLiveCourseView ()
  9. @property (nonatomic, copy) HotLiveCourseCallback callback;
  10. @end
  11. @implementation HomeLiveCourseView
  12. + (instancetype)shareInstance {
  13. HomeLiveCourseView *view = [[[NSBundle mainBundle] loadNibNamed:@"HomeLiveCourseView" owner:nil options:nil] firstObject];
  14. return view;
  15. }
  16. - (void)hotLiveMore:(HotLiveCourseCallback)callback {
  17. if (callback) {
  18. self.callback = callback;
  19. }
  20. }
  21. - (IBAction)moreLiveCourse:(id)sender {
  22. if (self.callback) {
  23. self.callback();
  24. }
  25. }
  26. - (CGFloat)getViewHeightWithCount:(NSInteger)count {
  27. return 56 + count * 126;
  28. }
  29. /*
  30. // Only override drawRect: if you perform custom drawing.
  31. // An empty implementation adversely affects performance during animation.
  32. - (void)drawRect:(CGRect)rect {
  33. // Drawing code
  34. }
  35. */
  36. @end