PreExamMarkHeaderView.m 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //
  2. // PreExamMarkHeaderView.m
  3. // LN_School
  4. //
  5. // Created by 张嵘 on 2019/7/31.
  6. // Copyright © 2019 Danson. All rights reserved.
  7. //
  8. #import "PreExamMarkHeaderView.h"
  9. #import "RQSearchView.h"
  10. @interface PreExamMarkHeaderView ()
  11. @property (nonatomic, readwrite, strong) RQSearchView *searchView;
  12. @end
  13. @implementation PreExamMarkHeaderView
  14. #pragma mark - Life Cycle
  15. - (instancetype)initWithFrame:(CGRect)frame {
  16. self = [super initWithFrame:frame];
  17. if (self) {
  18. [self addSubview:self.searchView];
  19. }
  20. __weak typeof (self) weakS = self;
  21. [self addTapActionWithBlock:^(UIGestureRecognizer *gestureRecoginzer) {
  22. [weakS clickSelf];
  23. }];
  24. return self;
  25. }
  26. - (void)layoutSubviews {
  27. [super layoutSubviews];
  28. [_searchView mas_makeConstraints:^(MASConstraintMaker *make) {
  29. make.center.mas_equalTo(self);
  30. make.size.mas_equalTo(CGSizeMake(self.bounds.size.width - 32, self.bounds.size.height - 32));
  31. _searchView.layer.cornerRadius = (self.bounds.size.height - 32) / 2.0;
  32. _searchView.layer.masksToBounds = YES;
  33. }];
  34. }
  35. #pragma mark - Private Functions
  36. - (void)updateSecVUI:(__kindof HDSectionModel *)model {
  37. }
  38. - (void)clickSelf {
  39. self.callback(self.hdSecModel);
  40. }
  41. #pragma mark - LazyLoad
  42. - (RQSearchView *)searchView {
  43. if (!_searchView) {
  44. _searchView = [[RQSearchView alloc] init];
  45. }
  46. return _searchView;
  47. }
  48. @end