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;
// 拿到 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;
相关文章推荐
- Swift项目中不能定义OC类继承Swift类
- OC模型类Swift存取
- Swift-获取本地所有图片并选取(Photos、PHAsset、CollectionView)
- Swift 2.0 String 与 Int 类型的转换
- Swift入门笔记1
- 正则表达式大全(深度解析)
- 用Swift实现笑脸
- swift开发多线程篇 - NSThread 线程相关简单说明(一些使用和注意点)
- Invalid Swift Support / invalid implementation of swift
- iOS开发技巧系列 使用Swift反射
- Swift中NSJSONSerialization类抛出异常的处理写法
- Swift快速入门视频
- swift实现ios类似微信输入框跟随键盘弹出的效果
- segmented control的使用
- swift3.0的改变
- Swift iOS实现把PCM语音转成MP3格式
- Swift基础进阶
- Swift基础语法
- Swift学习笔记三:运算符注意事项
- swift之mutating