鈿狅笍 Please fill out this template when filing an issue.
I have an array of views I show the SkeletonView on
let animation = SkeletonAnimationBuilder().makeSlidingAnimation(withDirection: .leftRight)
skeletonViews.forEach { $0.showAnimatedGradientSkeleton(animation: animation) }
Once my data is loaded I call
skeletonViews.forEach { $0.hideSkeleton() }
I have also run the same scenario with each show and hide call directly on the view/label.
My labels to be filled in with their original text.
The text is removed and the labels are empty.
Create labels in Interface Builder and set their text in IB. Show the gradient skeleton view and then hide it
SkeletonView version: 1.2.1
Xcode version: 9.4.1
Swift version: 4.1
Same problem for me
Upon further digging into tickets and PRs it looks like this might be the intended action.
Would be nice to have the option to revert back to the old text.
I believe it is a bug in Recoverable.swift line 43:
text = text == "" || forced ? viewState?.text : text
The text is always nil at it is set to this in PrepareForSkeletonProtocol.swift line 17:
extension UILabel: PrepareForSkeleton {
func prepareViewForSkeleton() {
text = nil
resignFirstResponder()
}
}
Changing the check in Recoverable.swift to check for a nil OR empty string fixes the bug:
text = text == nil || text == "" || forced ? viewState?.text : text
I will fork and put in a PR now!
I've just noticed that the bug was actually fixed a couple of weeks ago:
https://github.com/Juanpe/SkeletonView/commit/ff42bd02e2b08f2c2e43df2397bf48a2ca5f57d9
but as there hasn't been a tagged release for over a month, the changes won't get pulled in with Carthage/Pods
@Juanpe please tag a new release, it is a pretty critical bugfix. Thanks.
This bug is fixed in version 1.8 :)
@Juanpe Hey, sorry for commenting on a closed issue, but I'm on SkeletonView 1.8.2 and a couple of my Labels are being hidden. Upon logging their texts, it does print the correct text but the labels aren't shown. Even tried label.isHidden = false but still can't get them to show.
still an issue in 1.8.6
Most helpful comment
@Juanpe please tag a new release, it is a pretty critical bugfix. Thanks.