mirror of
https://github.com/mastodon/mastodon-ios.git
synced 2025-01-27 15:49:44 +01:00
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…
x
Reference in New Issue
Block a user