I'm using an attributed UILabel
with Regular x Regular variation. See the following screenshot:
In my view controller I'm setting a text value for the UILabel
:
class ViewController: UIViewController
{
// MARK: - Outlets
@IBOutlet weak var myLabel: UILabel!
// MARK: - Life Cycle
override func viewDidLoad()
{
super.viewDidLoad()
myLabel.text = "THIS IS MY TEXT"
}
}
When I run the app on device (iOS 13) label shows the right text ("THIS IS MY TEXT"). But if I send the app to background and open it again, the label resets the text to "Label", i.e my text that I set in code is lost. See this video for a better understanding.
On iOS 12 the text cannot be changed in code at all. If I remove the Variation then everything work just fine.