Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Issue #259: Prevent isSkeletonActive to be called when isSkeletonable is false #275

Merged
merged 2 commits into from
Mar 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions Sources/SkeletonView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand All @@ -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()
Expand Down