" HomeTabBarViewController"的冗余一致性协议' UITabBarControllerDelegate' iOS版

时间:2017-09-15 08:31:48

标签: ios swift uitabbarcontroller

首先,我是iOS编程的新手。我无法实施UITabBarControllerDelegate协议。我收到这个错误:

  

" HomeTabBarViewController"的冗余一致性协议   ' UITabBarControllerDelegate'

class HomeTabBarViewController: UITabBarController , UITabBarControllerDelegate {

    override func viewDidLoad() {
        super.viewDidLoad()
        self.delegate = self
    }

    func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) {
        print("didSelect viewController")
    }

    override func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) {
        print("didSelect item")
    }
}

如何解决此错误?

0 个答案:

没有答案