From 8a2a512bbb537755e59ffcba802f67148fa9c3f1 Mon Sep 17 00:00:00 2001 From: William Salim Date: Wed, 11 Mar 2020 17:38:30 +0700 Subject: [PATCH 1/2] Prevent isSkeletonActive to be called when isSkeletonable is false --- Sources/SkeletonView.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/SkeletonView.swift b/Sources/SkeletonView.swift index b6f488a7..19ba057e 100755 --- a/Sources/SkeletonView.swift +++ b/Sources/SkeletonView.swift @@ -101,7 +101,7 @@ extension UIView { @objc func skeletonTraitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { skeletonTraitCollectionDidChange(previousTraitCollection) - guard isSkeletonActive, let config = currentSkeletonConfig else { return } + guard isSkeletonable, isSkeletonActive, let config = currentSkeletonConfig else { return } updateSkeleton(skeletonConfig: config) } @@ -113,7 +113,7 @@ extension UIView { } private func recursiveShowSkeleton(skeletonConfig config: SkeletonConfig, root: UIView? = nil) { - guard !isSkeletonActive && isSkeletonable else { return } + guard isSkeletonable && !isSkeletonActive else { return } currentSkeletonConfig = config swizzleLayoutSubviews() swizzleTraitCollectionDidChange() From 5a75e006044be1fcbcdd1d2d52078c66310be508 Mon Sep 17 00:00:00 2001 From: William Salim Date: Fri, 13 Mar 2020 15:21:15 +0700 Subject: [PATCH 2/2] add PR #259 in the CHANGELOG file --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 699c6dc3..7f68b662 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file #### 🔬Improvements #### 🩹 Bug fixes +* [**259**](https://github.com/Juanpe/SkeletonView/issues/259): Prevent isSkeletonActive to be called when isSkeletonable is false ### 📦 [1.8.6](https://github.com/Juanpe/SkeletonView/releases/tag/1.8.6)