melieskubrick / CarbonKitSwift

CarbonKit is an iOS OpenSource libraries collection. CarbonKit includes: CarbonSwipeRefresh CarbonTabSwipeNavigation
MIT License
120 stars 33 forks source link

carbonTabSwipeNavigation call multiple times #15

Open umarmukhtar001 opened 4 years ago

umarmukhtar001 commented 4 years ago

When I used to Swipe the controller 2 it called 2 times due to which next class also called . Any Help would be much appreciated. func carbonTabSwipeNavigation(_ carbonTabSwipeNavigation: CarbonTabSwipeNavigation, viewControllerAt index: UInt) -> UIViewController { print("This is index(index)") guard let storyboard = storyboard else { return UIViewController() }

    switch index {
    case 0:
       return storyboard.instantiateViewController(withIdentifier: "SoundsController1") as! SoundsController1

    case 1:
        return storyboard.instantiateViewController(withIdentifier: "SoundsController2") as! SoundsController2

    case 2:
       return storyboard.instantiateViewController(withIdentifier: "SoundsController3") as! SoundsController3

    default:
        return self.storyboard!.instantiateViewController(withIdentifier: "RainSoundsController") as! RainSoundsController
    }
}