fix: home timeline initial setup may get wrong content offset issue

This commit is contained in:
CMK 2021-07-09 13:17:25 +08:00
parent d350213f6c
commit 27cdc44532
1 changed files with 2 additions and 5 deletions

View File

@ -33,13 +33,10 @@ extension HomeTimelineViewModel {
threadReplyLoaderTableViewCellDelegate: nil threadReplyLoaderTableViewCellDelegate: nil
) )
// make initial snapshot animation smooth
var snapshot = NSDiffableDataSourceSnapshot<StatusSection, Item>() var snapshot = NSDiffableDataSourceSnapshot<StatusSection, Item>()
snapshot.appendSections([.main]) snapshot.appendSections([.main])
diffableDataSource?.apply(snapshot) diffableDataSource?.apply(snapshot)
// workaround to append loader wrong animation issue
snapshot.appendItems([.bottomLoader], toSection: .main)
diffableDataSource?.apply(snapshot)
} }
} }