1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- //
- // CourseTimeSegView.m
- // KulexiuForTeacher
- //
- // Created by 王智 on 2022/6/22.
- //
- #import "CourseTimeSegView.h"
- @interface CourseTimeSegView ()
- @property (weak, nonatomic) IBOutlet UIImageView *arrowImage;
- @property (nonatomic, copy) CourseTimeSearchCallback callback;
- @end
- @implementation CourseTimeSegView
- - (void)awakeFromNib {
- [super awakeFromNib];
- self.arrowUp = NO;
- }
- + (instancetype)shareInstance {
- CourseTimeSegView *view = [[[NSBundle mainBundle] loadNibNamed:@"CourseTimeSegView" owner:nil options:nil] firstObject];
- return view;
- }
- - (void)sortAction:(CourseTimeSearchCallback)callback {
- if (callback) {
- self.callback = callback;
- }
- }
- - (void)setArrowUp:(BOOL)arrowUp {
- _arrowUp = arrowUp;
- NSString *imageName = arrowUp ? @"sort_up" : @"sort_down";
- [_arrowImage setImage:[UIImage imageNamed:imageName]];
- }
- - (IBAction)buttonClickAction:(id)sender {
- if (self.callback) {
- self.callback();
- }
- }
- /*
- // Only override drawRect: if you perform custom drawing.
- // An empty implementation adversely affects performance during animation.
- - (void)drawRect:(CGRect)rect {
- // Drawing code
- }
- */
- @end
|