This commit is contained in:
2025-11-11 19:39:33 +08:00
parent 20b13bcffa
commit 3440cc4773
4 changed files with 349 additions and 0 deletions

View File

@@ -8,6 +8,7 @@
#import "HomeMainVC.h"
#import "HomeHeadView.h"
#import "KBPanModalView.h"
#import "KBGuideVC.h" //
@interface HomeMainVC ()
@property (nonatomic, strong) HomeHeadView *headView;
@@ -43,6 +44,31 @@
[self.simplePanModalView presentInView:self.view];
}
// viewDidLoad push
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[self kb_showGuideIfFirstLaunch];
}
/// KBGuideVC
- (void)kb_showGuideIfFirstLaunch {
static NSString *const kKBHasLaunchedOnce = @"KBHasLaunchedOnce";
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
if (![ud boolForKey:kKBHasLaunchedOnce]) {
[ud setBool:YES forKey:kKBHasLaunchedOnce];
[ud synchronize];
// push线
if (self.navigationController && self.presentedViewController == nil) {
KBGuideVC *vc = [KBGuideVC new];
vc.hidesBottomBarWhenPushed = YES;
dispatch_async(dispatch_get_main_queue(), ^{
[self.navigationController pushViewController:vc animated:YES];
});
}
}
}
- (void)setupMas{
[self.headView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self.view);