AboutUsBodyView.m 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //
  2. // AboutUsBodyView.m
  3. // KulexiuForTeacher
  4. //
  5. // Created by Kyle on 2022/3/22.
  6. //
  7. #import "AboutUsBodyView.h"
  8. @interface AboutUsBodyView ()
  9. @property (weak, nonatomic) IBOutlet UILabel *versionLabel;
  10. @property (weak, nonatomic) IBOutlet UILabel *phoneLabel;
  11. @property (weak, nonatomic) IBOutlet UILabel *emailLabel;
  12. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *bottomSpace;
  13. @property (nonatomic, copy) DisplayCheckLinkCallback callback;
  14. @end
  15. @implementation AboutUsBodyView
  16. - (void)awakeFromNib {
  17. [super awakeFromNib];
  18. self.versionLabel.text = [NSString stringWithFormat:@"版本号%@",[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]];
  19. self.phoneLabel.text = @"15347100733";
  20. self.emailLabel.text = @"klx@kulexiu999.onexmail.com";
  21. self.bottomSpace.constant = 6 + iPhoneXSafeBottomMargin;
  22. }
  23. - (void)configPhone:(NSString *)phone email:(NSString *)email {
  24. self.phoneLabel.text = [NSString returnNoNullStringWithString:phone];
  25. self.emailLabel.text = [NSString returnNoNullStringWithString:email];
  26. }
  27. + (instancetype)shareInstance {
  28. AboutUsBodyView *view = [[[NSBundle mainBundle] loadNibNamed:@"AboutUsBodyView" owner:nil options:nil] firstObject];
  29. return view;
  30. }
  31. - (void)showCheckLink:(DisplayCheckLinkCallback)callback {
  32. if (callback) {
  33. self.callback = callback;
  34. }
  35. }
  36. - (IBAction)openWebView:(id)sender {
  37. if (self.callback) {
  38. self.callback();
  39. }
  40. }
  41. /*
  42. // Only override drawRect: if you perform custom drawing.
  43. // An empty implementation adversely affects performance during animation.
  44. - (void)drawRect:(CGRect)rect {
  45. // Drawing code
  46. }
  47. */
  48. @end