diff --git a/PanModal/Controller/PanModalPresentationController.swift b/PanModal/Controller/PanModalPresentationController.swift index 885b3d07..b9d4b7d4 100644 --- a/PanModal/Controller/PanModalPresentationController.swift +++ b/PanModal/Controller/PanModalPresentationController.swift @@ -446,7 +446,7 @@ private extension PanModalPresentationController { Set the appropriate contentInset as the configuration within this class offsets it */ - scrollView.contentInset.bottom = presentingViewController.bottomLayoutGuide.length + scrollView.contentInset.bottom = presentable?.bottomScrollInset ?? presentingViewController.bottomLayoutGuide.length /** As we adjust the bounds during `handleScrollViewTopBounce` @@ -771,7 +771,7 @@ private extension PanModalPresentationController { */ func trackScrolling(_ scrollView: UIScrollView) { scrollViewYOffset = max(scrollView.contentOffset.y, 0) - scrollView.showsVerticalScrollIndicator = true + scrollView.showsVerticalScrollIndicator = presentable?.shouldShowScrollIndicator ?? true } /** diff --git a/PanModal/Presentable/PanModalPresentable+Defaults.swift b/PanModal/Presentable/PanModalPresentable+Defaults.swift index 76a0679f..21193f90 100644 --- a/PanModal/Presentable/PanModalPresentable+Defaults.swift +++ b/PanModal/Presentable/PanModalPresentable+Defaults.swift @@ -124,5 +124,13 @@ public extension PanModalPresentable where Self: UIViewController { func panModalDidDismiss() { } + + var shouldShowScrollIndicator: Bool { + return true + } + + var bottomScrollInset: CGFloat? { + return nil + } } #endif diff --git a/PanModal/Presentable/PanModalPresentable.swift b/PanModal/Presentable/PanModalPresentable.swift index 76c15015..6ecc5c2a 100644 --- a/PanModal/Presentable/PanModalPresentable.swift +++ b/PanModal/Presentable/PanModalPresentable.swift @@ -233,5 +233,19 @@ public protocol PanModalPresentable: AnyObject { Default value is an empty implementation. */ func panModalDidDismiss() + + /** + A flag to determine should we show scroll indicator in normal state for scroll view + + Default value is true. + */ + var shouldShowScrollIndicator: Bool { get } + + /** + The inset for scroll view which will override default one (bottomLayoutGuide.height) + + Default value is true. + */ + var bottomScrollInset: CGFloat? { get } } #endif diff --git a/Sample/View Controllers/User Groups/UserGroupViewController.swift b/Sample/View Controllers/User Groups/UserGroupViewController.swift index e06ad5c5..0800116b 100644 --- a/Sample/View Controllers/User Groups/UserGroupViewController.swift +++ b/Sample/View Controllers/User Groups/UserGroupViewController.swift @@ -118,5 +118,4 @@ class UserGroupViewController: UITableViewController, PanModalPresentable { isShortFormEnabled = false panModalSetNeedsLayoutUpdate() } - }