Resize label to fit text amount - Swift
You'll want to do this:
myLabel.sizeToFit()
As seen here: https://developer.apple.com/documentation/uikit/uiview/1622630-sizetofit
This will update the label's frame to fit the content. You can then place it or make any edits after this that you want.