您的位置:首页 > 移动开发 > Swift

Swift获取到AppDelegate

2016-05-06 00:00 726 查看
摘要: 获取到AppDelegate



// 拿到 AppDelegate

let tempAppDelegate = UIApplication .sharedApplication().delegate;

tempAppDelegate!.window!!.rootViewController = XNMainController();

// 拿到 AppDelegate
let tempAppDelegate = UIApplication .sharedApplication().delegate as! AppDelegate;

OC

// 拿到 AppDelegate
AppDelegate *tempAppDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];

XNViewController *vc = [[XNViewController alloc]init];

tempAppDelegate.window.rootViewController = vc;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: