动态改变tabbar

            let appdelegate = UIApplication.shared.delegate as! AppDelegate

            let tabBarVC = appdelegate.window?.rootViewController as! UITabBarController

            var tabBars = tabBarVC.viewControllers

            tabBars?.remove(at: 1)
            tabBarVC.setViewControllers(tabBars, animated: true)
            appdelegate.window?.rootViewController = tabBarVC

你可能感兴趣的:(动态改变tabbar)