How to access ObjectAtIndex in tabBarController with Swift?

后端 未结 2 554
遥遥无期
遥遥无期 2021-02-14 03:08

i used to say in obj-c

[self.tabBarController.viewControllers objectAtIndex:1];

but now in swift no ObjectAtIndex any more

sel         


        
2条回答
  •  日久生厌
    2021-02-14 03:48

    You don't need objectAtIndex in swift, just use the subscript operator:

    self.tabBarController.viewControllers[1]
    

提交回复
热议问题