我正在尝试获取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'
我错过了什么吗?