Fix UIStackView Label Issue

Fixes issue where SkeletonView sets the text of each label to nil, UIStackView sets the height of each label to 0 and lays them out on top of each other.
This commit is contained in:
giantramen
2018-06-26 09:20:49 -05:00
committed by Kamin, Grant
parent 0136c8576c
commit ff42bd02e2
2 changed files with 4 additions and 4 deletions
@@ -14,14 +14,14 @@ protocol PrepareForSkeleton {
extension UILabel: PrepareForSkeleton {
func prepareViewForSkeleton() {
text = nil
text = " "
resignFirstResponder()
}
}
extension UITextView: PrepareForSkeleton {
func prepareViewForSkeleton() {
text = nil
text = " "
resignFirstResponder()
}
}
+2 -2
View File
@@ -40,7 +40,7 @@ extension UILabel {
override func recoverViewState(forced: Bool) {
super.recoverViewState(forced: forced)
text = text == "" || forced ? viewState?.text : text
text = text == " " || forced ? viewState?.text : text
}
}
@@ -52,7 +52,7 @@ extension UITextView {
override func recoverViewState(forced: Bool) {
super.recoverViewState(forced: forced)
text = text == "" || forced ? viewState?.text : text
text = text == " " || forced ? viewState?.text : text
}
}