0

Firstly I'm new in iOS programming. I can't implement UITabBarControllerDelegate protocol. I get this error :

Redundant conformance of "HomeTabBarViewController" to protocol '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")
    }
}

How can I fix this error?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
yusufonderd
  • 3,237
  • 4
  • 21
  • 34
  • You save my time thank you again :) – yusufonderd Sep 15 '17 at 08:36
  • @MartinR Yep it's a possible duplicate (p.s. are you able to take a look to https://stackoverflow.com/questions/46233398/transforming-randomaccessslice-to-randomaccesscollection) ;-) – Lorenzo B Sep 15 '17 at 08:36
  • The class name in the error message does not match the class name in the code. Are these the same (just with one changed before posting), or is there a separate `HomeTabBarViewController` defined somewhere? If so, can you post code for that? – Michael Hulet Sep 15 '17 at 08:39
  • @MichaelHulet I edited question. thank you for your interest – yusufonderd Sep 15 '17 at 08:42

0 Answers0