From 9c103103e8cb8641fd3deb94bf8c2158cc04bdec Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Mon, 12 Dec 2022 22:57:33 -0500 Subject: [PATCH] Fix ToastableViewController automatic scroll view detection not handling collection views --- Tusker/Views/Toast/ToastableViewController.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Tusker/Views/Toast/ToastableViewController.swift b/Tusker/Views/Toast/ToastableViewController.swift index 8827691d..25a65bd4 100644 --- a/Tusker/Views/Toast/ToastableViewController.swift +++ b/Tusker/Views/Toast/ToastableViewController.swift @@ -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)