Fix ToastableViewController automatic scroll view detection not handling collection views
This commit is contained in:
parent
382d8ef2c8
commit
9c103103e8
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue