presentModalViewController vs. pushViewController

2019-08-05 03:42发布

I can show a different view with this code:

[self presentModalViewController:childView animated:nil];

This code should do the same thing, right?

[self.navigationController pushViewController:childView animated:YES];

But it doesn't do anything. Why is that?

1条回答
Bombasti
2楼-- · 2019-08-05 04:07

pushViewController only works in navigation controllers

presentModalViewController works for all view controllers

查看更多
登录 后发表回答