From a3810046304833f86b503c9131818f05dd38cc3f Mon Sep 17 00:00:00 2001 From: Jesse Squires Date: Mon, 13 Mar 2017 09:27:20 -0700 Subject: [PATCH] Update Best Practices and FAQ.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: rnystrom Per recent internal discussions 😄 Closes https://github.com/Instagram/IGListKit/pull/536 Reviewed By: rnystrom Differential Revision: D4697189 Pulled By: jessesquires fbshipit-source-id: c3e465f6900c6c479057a47bd0ddfcae1ae1544f --- Guides/Best Practices and FAQ.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Guides/Best Practices and FAQ.md b/Guides/Best Practices and FAQ.md index a2c5161d..b3bafdcd 100644 --- a/Guides/Best Practices and FAQ.md +++ b/Guides/Best Practices and FAQ.md @@ -31,19 +31,19 @@ func didUpdate(to object: Any) { ## Frequently asked questions -**How do you implement separators between cells?** +#### How do you implement separators between cells? See discussion in [#329](https://github.com/Instagram/IGListKit/issues/329) -**How do I fix the error `Could not build Objective-C module 'IGListKit'`?** +#### How do I fix the error `Could not build Objective-C module 'IGListKit'`? See discussion in [#316](https://github.com/Instagram/IGListKit/issues/316) -**The documentation and examples have `` feature or changes, but I don't have it in my version. Why?** +#### The documentation and examples have `` feature or changes, but I don't have it in my version. Why? This feature is on the `master` branch only and hasn't been officially tagged and [released](https://github.com/Instagram/IGListKit/releases). If you need to, you can [install from the `master` branch](https://instagram.github.io/IGListKit/installation.html). -**Does `IGListKit` work with...?** +#### Does `IGListKit` work with...? - Core Data ([Working with Core Data](https://instagram.github.io/IGListKit/working-with-core-data.html) Guide) - AsyncDisplayKit ([AsyncDisplayKit/#2942](https://github.com/facebook/AsyncDisplayKit/pull/2942)) @@ -54,14 +54,18 @@ This feature is on the `master` branch only and hasn't been officially tagged an Yes. -**Does `IGListKit` work with `UITableView`?** +#### Does `IGListKit` work with `UITableView`? No, but you can install the [diffing subspec via CocoaPods](https://instagram.github.io/IGListKit/installation.html). -**What's the purpose of `IGListCollectionView`?** +#### What's the purpose of `IGListCollectionView`? We use this subclass to gain compile-time safety to prevent disallowed methods from being called on `UICollectionView`, because `IGListKit` handles model and view updates. See discussion at [#409](https://github.com/Instagram/IGListKit/issues/409). -**How can I manage cell selection and deselection?** +#### How can I manage cell selection and deselection? See discussion at [#184](https://github.com/Instagram/IGListKit/issues/184). + +#### I have a *huge* data set and [`-peformUpdatesAnimated: completion:`](https://instagram.github.io/IGListKit/Classes/IGListAdapter.html#/c:objc(cs)IGListAdapter(im)performUpdatesAnimated:completion:) is *super* slow. What do I do? + +If you have multiple thousands of items and you cannot batch them in, you'll see performance issues with `-peformUpdatesAnimated: completion:`. The real bottle neck behind the scenes here is `UICollectionView` attempting to insert so many cells at once. Instead, call [`-reloadDataWithCompletion:`](https://instagram.github.io/IGListKit/Classes/IGListAdapter.html#/c:objc(cs)IGListAdapter(im)reloadDataWithCompletion:) when you first load data, which will be super fast. Behind the scenes, this method *does not* do any diffing and simply calls `-reloadData` on `UICollectionView`. For subsequent updates, you can then use `-peformUpdatesAnimated: completion:`.