Getting the top most UIViewController

后端 未结 3 1479
不思量自难忘°
不思量自难忘° 2021-02-01 00:35

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:25

    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.

提交回复
热议问题