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) 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()