This commit is contained in:
2025-12-03 20:14:14 +08:00
parent eca168957d
commit 9651ae7ad7
7 changed files with 80 additions and 1 deletions

View File

@@ -13,12 +13,14 @@
#import "KBTestVC.h"
#import "KBNoticeVC.h"
#import "KBFeedBackVC.h"
#import "KBMyVM.h"
@interface MyVC () <UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) BaseTableView *tableView; //
@property (nonatomic, strong) KBMyHeaderView *header; //
@property (nonatomic, strong) NSArray<NSArray<NSDictionary *> *> *data; //
@property (nonatomic, strong) UIImageView *bgImageView; //
@property (nonatomic, strong) KBMyVM *viewModel; // VM
@end
@implementation MyVC
@@ -59,6 +61,20 @@
self.tableView.tableHeaderView = self.header;
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
//
if (!self.viewModel) {
self.viewModel = [[KBMyVM alloc] init];
}
__weak typeof(self) weakSelf = self;
[self.viewModel fetchUserDetailWithCompletion:^(KBUser * _Nullable user, NSError * _Nullable error) {
if (user) {
[weakSelf.header configureWithUser:user];
}
}];
}
// BaseViewController
#pragma mark - UITableView