Juanpe / SkeletonView

☠️ An elegant way to show users that something is happening and also prepare them to which contents they are awaiting
MIT License
12.51k stars 1.1k forks source link

UILabel with attributedText loses the text after changing isHidden #518

Closed markos92i closed 1 year ago

markos92i commented 1 year ago

Description

An skeletonable UILabel that we set an attributedText to loses it ending up with " " (a white space) for text instead of the previously contained text, resulting in that when that label is shown again via isHidden = false, the previous text is not shown.

The moment that UILabel is changed to NON skeletonable it works as expected.

Reproduced in iOS 16 with SkeletonView 1.30.2

What type of issue is this? (place an x in one of the [ ])

Requirements (place an x in each of the [ ])


Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

SkeletonView Environment:

SkeletonView version: 1.30.2 Xcode version: 14 **Swift version: 5.7

Steps to reproduce:

Please replace this with the steps to reproduce the behavior.

  1. Place an skeletonable UILabel in a viewcontroller
  2. Set an attributedText to that UILabel (for example label.attributedText = NSAttributedString(string: "example text", attributes: someAttributes))
  3. Call view.showAnimatedGradientSkeleton()
  4. UILabel.isHidden = true
  5. UILabel.isHidden = false
  6. Call view.hideSkeleton()

Expected result:

UILabel's attributedText.string should be "example text"

Actual result:

UILabel's attributedText.string is now " "

Attachments: