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:
@@ -14,14 +14,14 @@ protocol PrepareForSkeleton {
|
||||
|
||||
extension UILabel: PrepareForSkeleton {
|
||||
func prepareViewForSkeleton() {
|
||||
text = nil
|
||||
text = " "
|
||||
resignFirstResponder()
|
||||
}
|
||||
}
|
||||
|
||||
extension UITextView: PrepareForSkeleton {
|
||||
func prepareViewForSkeleton() {
|
||||
text = nil
|
||||
text = " "
|
||||
resignFirstResponder()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user