// // NewInterfaceReplacement.m // MingMen // // Created by 罗云飞 on 2017/5/19. // Copyright © 2017年 罗云飞. All rights reserved. // #import "NewInterfaceReplacement.h" #import "HuanXinHelper.h" @implementation NewInterfaceReplacement static NewInterfaceReplacement *sharedObj = nil; + (instancetype)sharedInstance { static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ sharedObj = [[super allocWithZone: NULL] init]; }); return sharedObj; } + (id) allocWithZone:(struct _NSZone *)zone { return [self sharedInstance]; } - (id) copyWithZone:(NSZone *) zone { return self; } - (void)replacementLogin { //退出云信账号、解绑阿里云推送账号、删除用户单例类以及本地缓存保存的数据 [UserHelper exitLogin]; //退出环信账号 [[HuanXinHelper sharedInstance] exitlogon]; //销毁之前的单利对象 [NewBasicTabbarController objectDealloc]; //给予系统0.5秒清除本地数据 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ // 跳转登录界面 // NewLoginViewController *startVc = [[NewLoginViewController alloc] init]; // UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:startVc]; // [AppDelegate shareDelegate].window.rootViewController = navi; }); } - (void)replacementController { //进入程序主控制界面 [[AppDelegate shareDelegate].window setRootViewController:[NewBasicTabbarController sharedInstance]]; } @end