Merge pull request #275 from BurhanDewantara/259

Fix Issue #259: Prevent isSkeletonActive to be called when isSkeletonable is false
This commit is contained in:
Juanpe Catalán
2020-03-13 11:23:24 +01:00
committed by GitHub
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -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)
+2 -2
View File
@@ -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()