我已将 Swift 项目从 Swift 2 更新到 Swift 4,但我正面临这个问题。 在迁移之前,它在 Swift 2 中运行良好。 但是迁移后出现错误
Sub-class must implement the PagerTabStripDataSource viewControllers(for:) method
当我在谷歌上找到解决方案时,有些人建议添加这个委托(delegate)。
func indicatorInfo(for pagerTabStripController: PagerTabStripViewController) -> IndicatorInfo {
return IndicatorInfo(title: "BASIC INFO")
}
我添加了这个功能,但这没有帮助。 谁能帮帮我吗? 谢谢。
最佳答案
检查 this link到 XLPagerTapStrip 的 GitHub 页面。许多名称从 swift 2 更改为 swift 3,并且错误提示您需要的函数在那里,因此您需要重新实现或重命名一些函数才能正常工作。
关于ios - 子类必须实现 PagerTabStripDataSource viewControllers(对于 :) method in XLPagerTabStripe library,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54593382/