Compare commits

...

2 Commits

2 changed files with 17 additions and 9 deletions

View File

@ -85,14 +85,14 @@ class TrendingStatusesViewController: UIViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
var snapshot = NSDiffableDataSourceSnapshot<Section, Item>()
snapshot.appendSections([.statuses])
snapshot.appendItems([.loadingIndicator])
dataSource.apply(snapshot, animatingDifferences: false)
Task {
if !loaded {
loaded = true
if !loaded {
loaded = true
var snapshot = NSDiffableDataSourceSnapshot<Section, Item>()
snapshot.appendSections([.statuses])
snapshot.appendItems([.loadingIndicator])
dataSource.apply(snapshot, animatingDifferences: false)
Task {
await loadTrendingStatuses()
}
}

View File

@ -35,7 +35,15 @@ extension ToastableViewController {
}
var toastParentView: UIView { view }
var toastScrollView: UIScrollView? { view as? UIScrollView }
var toastScrollView: UIScrollView? {
if let scrollView = view as? UIScrollView {
return scrollView
} else if let collectionVC = self as? CollectionViewController {
return collectionVC.collectionView
} else {
return nil
}
}
func showToast(configuration config: ToastConfiguration, animated: Bool) {
currentToast?.dismissToast(animated: false)