feat: add loader for initial snapshot in notification scene
This commit is contained in:
parent
d9490533ee
commit
6400729367
|
@ -29,6 +29,14 @@ extension NotificationViewModel {
|
||||||
delegate: delegate,
|
delegate: delegate,
|
||||||
dependency: dependency
|
dependency: dependency
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var snapshot = NSDiffableDataSourceSnapshot<NotificationSection, NotificationItem>()
|
||||||
|
snapshot.appendSections([.main])
|
||||||
|
diffableDataSource.apply(snapshot)
|
||||||
|
|
||||||
|
// workaround to append loader wrong animation issue
|
||||||
|
snapshot.appendItems([.bottomLoader], toSection: .main)
|
||||||
|
diffableDataSource.apply(snapshot)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ final class NotificationViewModel: NSObject {
|
||||||
|
|
||||||
// output
|
// output
|
||||||
var diffableDataSource: UITableViewDiffableDataSource<NotificationSection, NotificationItem>!
|
var diffableDataSource: UITableViewDiffableDataSource<NotificationSection, NotificationItem>!
|
||||||
|
|
||||||
// top loader
|
// top loader
|
||||||
private(set) lazy var loadLatestStateMachine: GKStateMachine = {
|
private(set) lazy var loadLatestStateMachine: GKStateMachine = {
|
||||||
// exclude timeline middle fetcher state
|
// exclude timeline middle fetcher state
|
||||||
|
|
Loading…
Reference in New Issue