0

I've updated Swift project from Swift 2 to Swift 4 and I'm facing this issue. Before migration it worked fine in Swift 2. But after migration error occurred

Sub-class must implement the PagerTabStripDataSource viewControllers(for:) method

As I found solution on google, Some people suggest to add this delegate.

func indicatorInfo(for pagerTabStripController: PagerTabStripViewController) -> IndicatorInfo {
    return IndicatorInfo(title: "BASIC INFO")
}

I added this function but this doesn't help. Can anyone please help me? Thanks.

Ioan Moldovan
  • 2,272
  • 2
  • 29
  • 54

2 Answers2

1

Check this link to the GitHub page for XLPagerTapStrip. Many names changed from swift 2 to swift 3 and the function that the error says you need is in there, so you'll need to reimplement o rename some functions for it to work.

Renzo Tissoni
  • 642
  • 9
  • 21
1

I missed this function.

override func viewControllers(for pagerTabStripController: PagerTabStripViewController) -> [UIViewController] {
...
}

When I add this function, it worked fine. It was like this before.

func viewControllersForPagerTabStrip(_ pagerTabStripController: PagerTabStripViewController) -> [UIViewController] {
}
Ioan Moldovan
  • 2,272
  • 2
  • 29
  • 54