IOS UIView的跳转

发布时间:2020-06-05 23:20:28 作者:大头狼小鬼
来源:网络 阅读:696
#pragma mark返回当前UIView的UIController
- (UIViewController *)funResponderVC{
    UIView *net = [super superview]; // 返回上一级的视图。直到找到UIViewController视图为止
    UIResponder *nextResponder = [next nextResponder];
    
    if ([nextResponder isKindOfClass:[UIViewController class]])
        
    {
        
        return (UIViewController *)nextResponder;
        
    }
    else{
        return nil;
    }
}

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

    [[self funResponderVC] presentViewController:vc animated:YES completion:nil];

这样就实现了UIVIew的跳转,其实可以写在UIViewController,不必这么麻烦,可是考虑到代码的封装性以及代码后期的修改,所以遇到在UIVIew的跳转是必不可少的。

推荐阅读:
  1. IOS学习动画一之 UIKit动画
  2. iOS 索引列 使用详解

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

ios ios ui

上一篇:TeX binary (tex) installed anywhere in your PATH

下一篇:Mysql数据库理论基础之十二 ---- 备份与还原

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》