美文网首页
在view里怎么push到某个页面

在view里怎么push到某个页面

作者: 这个姑凉儿 | 来源:发表于2022-05-14 15:34 被阅读0次
        HomeZhuTiViewController *vc = [[HomeZhuTiViewController alloc]init];
        [[self viewContainingController].navigationController pushViewController:vc animated:YES];
    
    -(UIViewController*)viewContainingController
    {
        UIResponder *nextResponder =  self;
        
        do
        {
            nextResponder = [nextResponder nextResponder];
    
            if ([nextResponder isKindOfClass:[UIViewController class]])
                return (UIViewController*)nextResponder;
    
        } while (nextResponder);
    
        return nil;
    }
    

    相关文章

      网友评论

          本文标题:在view里怎么push到某个页面

          本文链接:https://www.haomeiwen.com/subject/vixmurtx.html