diffrence between PushViewController and presentModalViewController in iphone

▼魔方 西西 提交于 2019-12-06 04:45:12

One major difference is that

pushViewController only works in navigation controllers

presentModalViewController works for all view controllers

A modal view is made so that it prevents you from doing anything except whatever it is that it wants you to do. You must do something specific to exit the modal state. The modal view also covers up the navigation bar.

When you use PushViewController, it's more flexible through the navigation bar. It doesn't require an extra action to exit to another view.

Adarsh V C

Difference in animation are

pushViewController will slide in your new view from right.

presentModalViewController will pop up your new view.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!