Difference between pushViewController and showViewController

前端 未结 2 1289
夕颜
夕颜 2021-02-18 12:35

What\'s the difference between pushViewController and showViewController methods on UINavigationController?

2条回答
  •  鱼传尺愫
    2021-02-18 13:23

    You use this method to decouple the need to display a view controller from the process of actually presenting that view controller onscreen.

    Using this method, a view controller does not need to know whether it is embedded inside a navigation controller or split-view controller. It calls the same method for both. The UISplitViewController and UINavigationController classes override this method and handle the presentation according to their design. For example, a navigation controller overrides this method and uses it to push vc onto its navigation stack.

    form Apple UIKit Documentation

提交回复
热议问题