View 跳转到controll

2017-02-13  本文已影响0人  武小倩

//按钮的响应方法

-(void)tap3Action:(UITapGestureRecognizer *)tap{

NSLog(@"点击了中间");

//跳转的页面初始化

clckViewController  *cc=[[clckViewController alloc]init];

//调用下面的方法跳转

// [[self viewController]presentViewController:cc animated:YES completion:nil];

[[self viewController].navigationController pushViewController:cc animated:YES];

}

//方法

-(UIViewController *)viewController{

for (UIView *next=[self superview]; next; next=next.superview) {

UIResponder *nexrResponder=[next nextResponder];

if ([nexrResponder isKindOfClass:[UIViewController class]]) {

return (UIViewController *)nexrResponder;

}

}

return nil;

}

上一篇 下一篇

猜你喜欢

热点阅读