0
2

More than 3 years have passed since last update.

DifferenceKit で reload した時に Cell がうまく反映されない

Posted at

DifferenceKit という UITableView 及び UICollectionView の差分更新ライブラリを使用していた時に、CollectionView の追加 Section も含めた changeSet を reload した時に主に iOS11系で(iPhone8で確認)うまく Cell が表示されないという問題に遭遇していました。具体的な CollectionView の状態としては下記のような感じで、セクションアイテムが空ではない場合にのみセクションを追加していました。

  • scrollDirection: .horizontal
  • estimatedItemSize: automaticSize

解決策

解決策としては、CollectionView のセクションを常時設置するように変更し、reload では Cell のアイテムのみ batchUpdate で更新できるようにしたところ,iOS11系でもうまく Cell が表示されるようになりました。
DifferenceKit の問題なのか、システムの問題なのかは現在のところ不明なので、分かり次第追記したいと思います。

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2