feat: add loader for initial snapshot and fix loader animation issue
This commit is contained in:
parent
80330c0809
commit
091856ddf0
|
@ -33,9 +33,13 @@ extension HomeTimelineViewModel {
|
||||||
threadReplyLoaderTableViewCellDelegate: nil
|
threadReplyLoaderTableViewCellDelegate: nil
|
||||||
)
|
)
|
||||||
|
|
||||||
// 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)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,9 @@ extension UserTimelineViewModel {
|
||||||
// set empty section to make update animation top-to-bottom style
|
// set empty section to make update animation top-to-bottom style
|
||||||
var snapshot = NSDiffableDataSourceSnapshot<StatusSection, Item>()
|
var snapshot = NSDiffableDataSourceSnapshot<StatusSection, Item>()
|
||||||
snapshot.appendSections([.main])
|
snapshot.appendSections([.main])
|
||||||
|
diffableDataSource?.apply(snapshot)
|
||||||
|
|
||||||
|
// workaround to append loader wrong animation issue
|
||||||
snapshot.appendItems([.bottomLoader], toSection: .main)
|
snapshot.appendItems([.bottomLoader], toSection: .main)
|
||||||
diffableDataSource?.apply(snapshot)
|
diffableDataSource?.apply(snapshot)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue