Fix ToastableViewController automatic scroll view detection not handling collection views

This commit is contained in:
Shadowfacts 2022-12-12 22:57:33 -05:00
parent 382d8ef2c8
commit 9c103103e8
1 changed files with 9 additions and 1 deletions

View File

@ -35,7 +35,15 @@ extension ToastableViewController {
} }
var toastParentView: UIView { view } 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) { func showToast(configuration config: ToastConfiguration, animated: Bool) {
currentToast?.dismissToast(animated: false) currentToast?.dismissToast(animated: false)