我需要显示UITabBarController
,但是不需要它将我从viewControllers
阵列切换到Controller。我可以重新分配活动,还是创建自己的TabBarController
这样更好?
答案 0 :(得分:3)
您可以为UITabBarController创建一个子类,并确认到UITabBarControllerDelegate
然后,您可以使用shouldSelect方法执行自定义标签部分的操作。
func tabBarController(_ tabBarController: UITabBarController,
shouldSelect viewController: UIViewController) -> Bool
{
if viewController == secondViewController {
//Do your actions
return false
}
return true
}