Getting the top most UIViewController

后端 未结 3 1442
不思量自难忘°
不思量自难忘° 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:30

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

提交回复
热议问题