From 7e2849e26b61f894d3a5151e885d0f64e8e194f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanpe=20Catala=CC=81n?= Date: Fri, 30 Mar 2018 14:31:05 +0200 Subject: [PATCH] fix: Issue #46 --- Sources/Collections/CollectionSkeletonProtocol.swift | 9 ++++----- Sources/Collections/UIView+CollectionSkeleton.swift | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Sources/Collections/CollectionSkeletonProtocol.swift b/Sources/Collections/CollectionSkeletonProtocol.swift index a9f5821b..1b5bb44a 100644 --- a/Sources/Collections/CollectionSkeletonProtocol.swift +++ b/Sources/Collections/CollectionSkeletonProtocol.swift @@ -18,15 +18,14 @@ protocol CollectionSkeleton { func addDummyDataSource() func removeDummyDataSource(reloadAfter: Bool) - func disableScrolling() - func enableScrolling() + func disableUserInteraction() + func enableUserInteraction() } extension CollectionSkeleton where Self: UIScrollView { var estimatedNumberOfRows: Int { return 0 } func addDummyDataSource() {} func removeDummyDataSource(reloadAfter: Bool) {} - func disableScrolling() { isScrollEnabled = false } - func enableScrolling() { isScrollEnabled = true } - + func disableUserInteraction() { isUserInteractionEnabled = false } + func enableUserInteraction() { isUserInteractionEnabled = true } } diff --git a/Sources/Collections/UIView+CollectionSkeleton.swift b/Sources/Collections/UIView+CollectionSkeleton.swift index 8e2e6b43..d1d266db 100644 --- a/Sources/Collections/UIView+CollectionSkeleton.swift +++ b/Sources/Collections/UIView+CollectionSkeleton.swift @@ -12,12 +12,12 @@ extension UIView { func addDummyDataSourceIfNeeded() { guard let collection = self as? CollectionSkeleton else { return } collection.addDummyDataSource() - collection.disableScrolling() + collection.disableUserInteraction() } func removeDummyDataSourceIfNeeded(reloadAfter reload: Bool = true) { guard let collection = self as? CollectionSkeleton else { return } collection.removeDummyDataSource(reloadAfter: reload) - collection.enableScrolling() + collection.enableUserInteraction() } }