NotiferNavView.m 921 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //
  2. // NotiferNavView.m
  3. // KulexiuForTeacher
  4. //
  5. // Created by 王智 on 2022/6/22.
  6. //
  7. #import "NotiferNavView.h"
  8. @interface NotiferNavView ()
  9. @property (nonatomic, copy) NotiferCallback callback;
  10. @end
  11. @implementation NotiferNavView
  12. + (instancetype)shareInstance {
  13. NotiferNavView *view = [[[NSBundle mainBundle] loadNibNamed:@"NotiferNavView" owner:nil options:nil] firstObject];
  14. return view;
  15. }
  16. - (void)notiferNavAction:(NotiferCallback)callback {
  17. if (callback) {
  18. self.callback = callback;
  19. }
  20. }
  21. - (IBAction)backAction:(id)sender {
  22. if (self.callback) {
  23. self.callback(YES);
  24. }
  25. }
  26. - (IBAction)clearAction:(id)sender {
  27. if (self.callback) {
  28. self.callback(NO);
  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