-1

Yesterday Apple released Xcode 12 GM and iOS 14 so I don't know if this is a bug or not.

I've built an UIView with 3 UILabels in it. These labels are filled and updated after an API request. After I run my project in Xcode the UILabels are perfect, but after a second start the width of these labels are broken.

Really weird because this is not happened on the first run. These labels are filled with API data, so we can't set a fixed width.

Label settings:

Text: Plain
Default text: -
Lines: 1
Line Break: Character Wrap
Baseline: Align Baselines

Screenshot after first start (Xcode build/run) on my iPhone with iOS 14:

Screenshot after second start. (force closed first session and clicked on app icon):

Xcode 12 contraints:

Bjorn
  • 71
  • 6
  • Run the app from Xcode, and switch into the Xcode View Debugger to investigate the constraint situation. I'm betting you will see exclamation marks indicating that there is something wrong with your constraints. (They are probably ambiguous.) – matt Sep 16 '20 at 14:40

1 Answers1

0

Fix for my problem is:

label.sizeToFit()

Akhilesh Mishra
  • 5,876
  • 3
  • 16
  • 32
Bjorn
  • 71
  • 6