Iglistkit: How to disable NSObject+IGListDiffable

Created on 17 Nov 2016  路  3Comments  路  Source: Instagram/IGListKit

I'd like to not import NSObject+IGListDiffable so that I'll have to adopt that protocol manually, so that i'll get compiler checks on the objects I use in the IGList.
Now I don't see any errors if by mistake I return an object that doesn't implement isEqual. or if they fallback to the generic NSObject implementation.
Can I import IGListKit without import the NSObject+IGListDiffable category using cocoapods?

bug enhancement question

Most helpful comment

We could remove #import <IGListKit/NSObject+IGListDiffable.h> from the umbrella header...

I think we should definitely do this. Having all of this implicit conformance is too much "magic" IMO.

In the IGListDiffable docs, we should @note: that you can use NSObject+IGListDiffable.h.

All 3 comments

I'd actually love to get this to work. We could remove #import <IGListKit/NSObject+IGListDiffable.h> from the umbrella header and document that it has to be imported manually (including in the Swift bridging header).

However w/ the Swift bridging header, all Swift NSObjects will auto conform, so that doesn't help. At least you can create a Swift class that conforms to IGListDiffable without inheriting from NSObject.

@jessesquires what do you think? I could experiment w/ it. Could fit this in for 2.0.0 esp since we changed the equality method to -isEqualToDiffableObject:, that'll go hand-in-hand I think.

We could remove #import <IGListKit/NSObject+IGListDiffable.h> from the umbrella header...

I think we should definitely do this. Having all of this implicit conformance is too much "magic" IMO.

In the IGListDiffable docs, we should @note: that you can use NSObject+IGListDiffable.h.

Resolved in 316fbe2b8b2508b58a0f38387c3a343b9c37e282

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PhilCai1993 picture PhilCai1993  路  3Comments

rnystrom picture rnystrom  路  3Comments

omerfarukyilmaz picture omerfarukyilmaz  路  3Comments

FazeelAkhtar picture FazeelAkhtar  路  3Comments

iwasrobbed picture iwasrobbed  路  3Comments