Getting the top most UIViewController

后端 未结 3 1787
轮回少年
轮回少年 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:27

    NSArray *viewContrlls=[[self navigationController] viewControllers];
    
    [viewContrlls lastObject];
    

提交回复
热议问题