Iglistkit: Class does not conform to IGListAdapterDataSource even after implementing all required methods

Created on 16 Dec 2017  路  5Comments  路  Source: Instagram/IGListKit

New issue checklist

General information

  • IGListKit version: IGListKit (~> 3.0)
  • iOS version(s): >=8.0
  • CocoaPods/Carthage version: COCOAPODS: 1.3.1
  • Xcode version: Version 9.1 (9B55)
  • Devices/Simulators affected: NA
  • Reproducible in the demo project? (Yes/No): No
  • Related issues: NA

Debug information

I cannot build my project and I really cannot get what is going on. My view controller conforms to IGListAdapterDataSource and I implement the three methods

func objects(for listAdapter: IGListAdapter) -> [IGListDiffable] {
return loader.entries
}

func listAdapter(_ listAdapter: IGListAdapter, sectionControllerFor object: Any) -> IGListSectionController {
    return IGListSectionController() 
}

func emptyView(for listAdapter: IGListAdapter) -> UIView? { return nil }

But XCode tells me my class does not conform to the protocol. The problem seems to be with

func listAdapter(_ listAdapter: IGListAdapter, sectionControllerFor object: Any) -> IGListSectionController

where Xcode puts a grey alert stating:

  1. Candidate has non-matching type '(IGListAdapter, Any) -> IGListSectionController'

But the point is that the Examples compile and I mean, I'm just starting the project and I really do not customize it yet. In the Examples anyway I can see the IG prefix is not there for the working of the kit. So is maybe my pod version not updated? I'm using the recommended one though.

# Please include debug logs using the following lldb command:
po [IGListDebugger dump]
question

All 5 comments

@freddiemash can you remove all the IG prefixes? Those have been removed in Swift with IGListKit 3.0.

Sent with GitHawk

Hi @rnystrom , tnx for prompt reply.

I get this red alert

Use of undeclared type 'ListSectionController'

and same for the other elements when I remove the IG.
I'm following your raywenderlich tutorial btw, so started with the Marslink project included therein. I've just created the FeedController and I'm now at the datasource step.

The most recent Marslink project download is still referencing IGListKit version 1, and the change (as Ryan said) to drop the IG prefix was definitely in version 3.

Can you verify the version you have installed within your Podfile.lock?

Hi @Sherlouk , yes it was 1.0.0 but I updated to 3.1.1 and the problem is still there.
I think that I will start over with a project from scratch, maybe the Marslink is referencing other outdated components.

Ya that tutorial might be a bit outdated. I鈥檇 definitely recommend starting a fresh project, or using some of our examples as a starting point!

Sent with GitHawk

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rnystrom picture rnystrom  路  3Comments

krysztalzg picture krysztalzg  路  3Comments

kanumuri9593 picture kanumuri9593  路  3Comments

joseph-francis picture joseph-francis  路  3Comments

runmad picture runmad  路  3Comments