HomeNavView.m 941 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //
  2. // HomeNavView.m
  3. // KulexiuForTeacher
  4. //
  5. // Created by Kyle on 2022/3/28.
  6. //
  7. #import "HomeNavView.h"
  8. @interface HomeNavView ()
  9. @property (nonatomic, copy) HomeNavCallback callback;
  10. @end
  11. @implementation HomeNavView
  12. + (instancetype)shareInstance {
  13. HomeNavView *view = [[[NSBundle mainBundle] loadNibNamed:@"HomeNavView" owner:nil options:nil] firstObject];
  14. return view;
  15. }
  16. - (void)displayMessageCenter:(HomeNavCallback)callback {
  17. if (callback) {
  18. self.callback = callback;
  19. }
  20. }
  21. - (IBAction)navAction:(id)sender {
  22. if (self.callback) {
  23. self.callback(HOMENAV_ACTION_MESSAGE);
  24. }
  25. }
  26. - (IBAction)scanAction:(id)sender {
  27. if (self.callback) {
  28. self.callback(HOMENAV_ACTION_SCAN);
  29. }
  30. }
  31. /*
  32. // Only override drawRect: if you perform custom drawing.
  33. // An empty implementation adversely affects performance during animation.
  34. - (void)drawRect:(CGRect)rect {
  35. // Drawing code
  36. }
  37. */
  38. @end