fix crash when calling reloadObjects during an update
Summary: Follow up to D47263265
What’s happening
We’re calling
listAdapter.reloadObjects(...)
in the middle of the IGListKit’s internal data update, so it’s using the new section index path, instead of the old one. So we’re going from a list of 2, insert at 0, and try to reload index 1, then we crash (it’ll try to update index 2, which doesn’t exist in the old array)Fix
Just like for
[IGListAdapter performBatchAnimated:updates:completion:]
, lets use the old index. To get this working, lets ask the updater if we’re in an update, rather thanIGListAdapter
try to keep track of it.Sorry the diff is a bit long, but in case this feels reasonable to pick, I might
Differential Revision: D47281472
fbshipit-source-id: 193153cfc15c87084b67f58c50e921db459d6800
一个数据驱动的
UICollectionView
框架,用于构建快速灵活的列表。performBatchUpdates(_:, completion:)
或reloadData()
UICollectionView
的核心特性IGListKit
由 Instagram 工程师 创建 并且❤️ 维护。 我们在 Instagram 中使用开源的main
主版本。多语言翻译
英文README
要求
安装
CocoaPods
推荐使用CocoaPods来进行安装,只需添加如下语句到你的
Podfile
文件中:Carthage
对于Carthage, 添加如下到
Cartfile
文件中:入门指南
文档
这里可以查阅文档。文档由jazzy生成,托管在 GitHub-Pages。
运行位于仓库根目录下的
./scripts/build_docs.sh
脚本来生成文档。远景
想要了解
IGListKit
的长期目标和愿景,请阅读Vision。贡献
请查看CONTRIBUTING来了解如何参与贡献。在 Instagram,我们每日都会同步开源版本的
IGListKit
,因此我们总是在测试最新的改动。但是这也需要所有的改动都需要经历完全的测试,并且遵守我们的开发风格。我们有一系列新人任务,来帮助新人学习如何参入其中。
License
IGListKit
遵循MIT-licensed。/Examples/
目录下的文件,在文档里指明了它们各自所遵循的协议。文档遵循CC-BY-4.0。