iOS使用MVC如何在View中Push视图

// 获取当前View所在的viewController

- (UIViewController*)viewController {

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

         UIResponder* nextResponder = [next nextResponder];

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

           return (UIViewController*)nextResponder;}
}
return nil;
}

//调用上面的方法进行pushController

WYNWeddingBigVC *wedding = [[WYNWeddingBigVC alloc] init];

wedding.hidesBottomBarWhenPushed = YES;

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

你可能感兴趣的:(iOS使用MVC如何在View中Push视图)