IGListKit
IGListKit copied to clipboard
Method 'sectionController(_:didSelectItemAt:viewModel:)' has different argument labels from those required by protocol
New issue checklist
- [X] I have reviewed the
READMEand documentation - [X] I have searched existing issues and this is not a duplicate
- [X] I have attempted to reproduce the issue and include an example project.
General information
-
IGListKitversion: 4.0.0 - iOS version(s): 13.2.2
- CocoaPods/Carthage version: CocoaPods 1.9
- Xcode version: 11.2.1
- Devices/Simulators affected: all
- Reproducible in the demo project? (Yes/No): no
- Related issues:
I just updated my pods, including IGListKit to 4.0.0. Now, every instance in the app where I use sectionController didSelectItemAt is now throwing an error.
Method 'sectionController(_:didSelectItemAt:viewModel:)' has different argument labels from those required by protocol 'ListBindingSectionControllerSelectionDelegate' ('sectionController(_:didDeselectItemAt:viewModel:)')
Method 'sectionController(_:didSelectItemAt:viewModel:)' has different argument labels from those required by protocol 'ListBindingSectionControllerSelectionDelegate' ('sectionController(_:didHighlightItemAt:viewModel:)')
Method 'sectionController(_:didSelectItemAt:viewModel:)' has different argument labels from those required by protocol 'ListBindingSectionControllerSelectionDelegate' ('sectionController(_:didUnhighlightItemAt:viewModel:)')
My code:
extension InfoSectionController: ListBindingSectionControllerSelectionDelegate {
func sectionController(_ sectionController: ListBindingSectionController<ListDiffable>,
didSelectItemAt index: Int,
viewModel: Any) {
if let viewModel = viewModel as? NavigationProvidable {
viewController?.present(viewModel.navigation)
}
}
}
I've checked the documentation, and the signature appears correct. Anyone have any suggestions as to what I need to do here?
If I add empty stubs for the other methods, it works:
func sectionController(_ sectionController: ListBindingSectionController<ListDiffable>, didDeselectItemAt index: Int, viewModel: Any) {
}
func sectionController(_ sectionController: ListBindingSectionController<ListDiffable>, didHighlightItemAt index: Int, viewModel: Any) {
}
func sectionController(_ sectionController: ListBindingSectionController<ListDiffable>, didUnhighlightItemAt index: Int, viewModel: Any) {
}
Hello, may I ask if the problem has been solved