Iglistkit: [Guide] Best Practices and/or FAQ

Created on 11 Jan 2017  路  16Comments  路  Source: Instagram/IGListKit

I was thinking about some common bugs (and one's that I've run into) this morning.

It would be nice to have a "Best Practices" / "Tips" / "FAQ" guide in the docs.


Some initial notes:

  • Assert isKindOfClass: on the object you receive in -didUpdateToObject: in your section controllers (Makes it easy to track down simple mistakes in ListAdapaterDataSource implementation and non-unique diff identifiers)
  • Make sure your diff identifiers are unique
  • Look up questions in GH issues and see if there's anything else worth calling out
enhancement starter-task

Most helpful comment

"Does IGListKit work with"

  • Core Data (#460, #461)
  • AsyncDisplayKit
  • ComponentKit
  • React Native
  • Reactive Cocoa

yes

All 16 comments

Combed issues, two that stood out:

  • Adding separators between cells/sections #329
  • "Could not build module IGListKit" with Swift interop #316 (gotten this on Twitter before too)

"Documentation/Examples have this particular feature, but I don't have it in my version"?

  • Probably hasn't been released, wait or use latest from master

Note: we'll need to branch from stable to add these guides and re-gen docs, then merge that branch into master.

This will keep docs updated for guides, but not gen docs for new & breaking changes on master.

馃憣

"Does IGListKit work with"

  • Core Data (#460, #461)
  • AsyncDisplayKit
  • ComponentKit
  • React Native
  • Reactive Cocoa

yes

  • UITableView
    > no (but you can take advantage of just diffing using the subspec!)

FAQ: "why does IGListCollectionView exist?" (ref: #409)

Hello,

I've just started looking at IGListKit because I saw the ASDK team is currently implementing it and came here because I couldn't find any other place to ask the following very general question.

Why is IGListKit using Sections to represent a single item instead of a plain custom cell ? Is there any compelling reason for this or is this due to "historical" reasons ? Would love to know more about this. Thanks!

Ok, I thought about this a little and realised how much more power/flexibility using a section instead of a custom cell gives you in terms of creating complex layouts to represent a single item. Sorry for the noise.

Multi selection #184

Hello, guys.

I'm currently looking into IGListKit and one question is bothering me. I thought that you've made a decision to use section controller for single object to decompose huge complex cells in smaller, thinner ones. That should be improving scroll performance and simplifying code. For example, post should have one section controller with multiple cells representing header view, content view, comments view, etc. But in your examples I see that for such case you use separate section controllers for each part of the post. So what is the right way to do such thing? And, if example is canonical, that is the point to have section controllers with single cell?

Hey @Nodepad! Could you point to which example is misleading?

We do use a single section controller for posts that have multiple cells in Instagram and it works great.

A lot of our examples are _really_ simple, might mean we need to get something more complicated! You can check out this tutorial or my weather app for something more real.

@rnystrom Thanks for clarification.
I'm talking about example inObjcDemoViewController.m. There is a separate section controller for each part of the post.

@Nodepad hmm thanks for flagging. I'll spin through that and update if its too misleading. Sorry about that!

@rnystrom do you have an example that IGListKit works with React Native? Thanks!

@bduyng we don't, but that would be awesome if someone wants to make one! We'd be happy to link to it from our guides.

Should talk with @ocrickard, he got it working internally 馃槈

Is there any best practice of using IGListKit with ReactiveObjc?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kanumuri9593 picture kanumuri9593  路  3Comments

rnystrom picture rnystrom  路  3Comments

omerfarukyilmaz picture omerfarukyilmaz  路  3Comments

shuhrat10 picture shuhrat10  路  3Comments

drinkius picture drinkius  路  3Comments