您的位置:首页 > 产品设计 > UI/UE

ios tableViewCell 跳转获取 UIViewController

2015-05-27 16:25 274 查看
#pragma remark -tableviewCell 上级控制器   (可以放到公共方法类中 方便调用)
+(UIViewController *)viewController:(UIView *)view
{
    UIResponder *next = [viewnextResponder];
    do {
        if ([nextisKindOfClass:[UIViewControllerclass]])
{
            return (UIViewController *)next;
        }
        
        next = [next nextResponder];
        
    } while (next !=nil);
    
    
    returnnil;
}

//cell里面直接调用viewController 获取控制器

PictureViewController *pic =[[PictureViewControlleralloc]
init];
// 对模式对话框 弹出view

[[UIUtilsviewController:self]presentViewController:pic
                                        animated:YES
                                      completion:nil];
//或者 push

[[UIUtilsviewController:self].navigationControllerpushViewController:pic
animated:YES]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: