//按钮的响应方法
-(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;
}