我有一个 UITabBar Controller ,我的其他 ViewController 嵌套在其中。我想添加一个注销按钮,它只会触发警报,不会进入另一个 View Controller 。我该怎么做?
最佳答案
您可以使用 UITabBarControllerDelegate 在用户尝试显示选项卡时收到通知。在这个委托(delegate)方法中,你可以返回 false 并拦截来做你想做的事。
方法如下:
func tabBarController(tabBarController: UITabBarController, shouldSelectViewController viewController: UIViewController) -> Bool {
}
关于ios - 如何将注销按钮添加到我的 UITabBar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41618116/