获取iOS手机当前最上层的veiwcontroller
来源:互联网 发布:深圳淘宝免费运营 编辑:程序博客网 时间:2024/06/05 17:14
//获取手机当前显示的ViewController
+ (UIViewController*)currentViewController{
UIViewController* vc = [UIApplicationsharedApplication].keyWindow.rootViewController;
while (1) {
if ([vcisKindOfClass:[UITabBarControllerclass]]) {
vc = ((UITabBarController*)vc).selectedViewController;
}
if ([vcisKindOfClass:[UINavigationControllerclass]]) {
vc = ((UINavigationController*)vc).visibleViewController;
}
if (vc.presentedViewController) {
vc = vc.presentedViewController;
}else{
break;
}
}
return vc;
}
阅读全文
0 0
- 获取iOS手机当前最上层的veiwcontroller
- iOS 获取当前最上层ViewController
- 获取当前页面的类(最上层的类)
- iOS UIWindow:获取屏幕最上层的窗口
- iOS 应用获取最上层全屏 Window 的正确方法
- iOS 应用获取最上层全屏 Window 的正确方法
- iOS手机获取当前的IP
- iOS 获取当前最顶层的ViewController
- [iOS]获取iOS UI框架中最上层的UIViewController对象
- 判断当前最上层的应用的方法
- iOS如何获取手机当前的网络状态
- iOS如何获取手机当前的网络状态
- ios关于如何获取手机当前的ip
- iOS开发 - 获取当前View最顶层的ViewController
- iOS开发之获取当前最顶层的ViewController
- iOS开发 获取当前视图最顶层的ViewController
- 关于js获取最上层window对象的架构思路
- IOS 屏幕做一个最上层全屏幕的layer
- win32窗口程序-------3、位图及去除背景色
- (三)创建功能模块
- c_day05 联合体-枚举
- IoC之两种获得Bean容器的方法与区别
- 《effective c++》学习笔记(三)
- 获取iOS手机当前最上层的veiwcontroller
- java集合之ArrayList方法的使用实例
- mysql学习笔记
- scrollview 滚动条
- FFT代码实现
- java
- MPLS VPN场景下LDP和MP-BGP分发标签的区别
- HDU 3987 Harry Potter and the Forbidden Forest(最小割的最少割边数)
- 键盘一直自动按/问题的解决。。。