Getting the top most UIViewController

后端 未结 3 1799
轮回少年
轮回少年 2021-02-01 00:36

If I push view controllers and/or present modal view controllers on a UINavigationController, how can I find out what is the top most UIViewController?

3条回答
  •  终归单人心
    2021-02-01 01:10

    You want visibleViewController:

    The currently visible view can belong either to the view controller at the top of the navigation stack or to a view controller that was presented modally.

提交回复
热议问题