// // CYLaunchViewController.m // shiku_im // // Copyright © 2019 Reese. All rights reserved. // #import "CYLaunchViewController.h" @interface CYLaunchViewController () @property (nonatomic,strong) NSTimer *timer; @property (nonatomic,strong) UIButton *button; @property (nonatomic,strong) UIImageView *imgView; @end @implementation CYLaunchViewController{ int a ; } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. //启动页 self.imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)]; // self.imgView.image = [UIImage imageNamed:@"IMG_4803.png"]; // self.imgView.image = [UIImage imageWithData:data]; self.imgView.image = [UIImage imageNamed:@"LaunchImage"]; // self.imgView.userInteractionEnabled = YES; // imgView.backgroundColor = UIColor.redColor; [self.view addSubview:self.imgView]; // [g_server getappLogoIcon:self]; // [g_server getCompanyAuto:self]; AFNetworkReachabilityManager *manager = [AFNetworkReachabilityManager sharedManager]; [manager startMonitoring]; [manager setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) { if (status == AFNetworkReachabilityStatusReachableViaWWAN || status == AFNetworkReachabilityStatusReachableViaWiFi) { __weak typeof(self)weakSelf = self; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1), dispatch_get_main_queue(), ^{ [weakSelf goToLoginVc]; }); }else { [g_App showAlert:@"网络不可用,请检查网络"]; } }]; } -(void)gotoLoginClick{ [self.timer invalidate]; self.timer = nil; [g_App showLoginUI]; } -(void)goToLoginVc{ if (a == 0) { [[NSUserDefaults standardUserDefaults] setObject:@"1" forKey:@"cylunch"]; [[NSUserDefaults standardUserDefaults] synchronize]; [g_App showLoginUI]; [self.timer invalidate]; self.timer = nil; } [self.button setTitle:[NSString stringWithFormat:@"跳过 %ds",a] forState:UIControlStateNormal]; a -= 1; } -(void) didServerResultSucces:(JXConnection*)aDownload dict:(NSDictionary*)dict array:(NSArray*)array1{ } /* #pragma mark - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { // Get the new view controller using [segue destinationViewController]. // Pass the selected object to the new view controller. } */ @end