相关疑难解决方法(0)

获取选定的索引标签栏控制器Swift

我正在尝试获取tabbarController的选定索引.

let application = UIApplication.sharedApplication().delegate as AppDelegate
let tabbarController = application.tabBarController as UITabBarController
let selectedIndex = tabBarController.selectedIndex
Run Code Online (Sandbox Code Playgroud)

我收到这个错误: 'UITabBarController?' does not have a member named 'selectedIndex'

我错过了什么吗?

selectedindex uitabbarcontroller ios swift

3
推荐指数
1
解决办法
2万
查看次数

标签 统计

ios ×1

selectedindex ×1

swift ×1

uitabbarcontroller ×1