When setting some string value to the text attribute of a UILabel like
var a : UILabel
a.text = "Variable length string"
autolayout resizes it using the constraints font size, label number of lines etc.
The question is, if I needed to get the size of that label so that I can ( for example ) decide how high a tablecell that includes this label should be, at what point should I do this successfully?
Trying to figure this out without using UITableviewAutomaticDimension.
EDIT: The answer posted as a possible duplicate bears some resemblence. However, my main confusion is as to where I can extract the height of the UILabel successfully and with certainty.
It has been many times that I have tried to get a view's size but the value I get back is not accurate and need to resort to using viewDidLayoutSubviews() in some form. I guess I don't understand the order of which things happen in the layout very well. And it seems to be different for viewDidLoad() and awakeFromNib() too but I might be mistaken about this.
If anyone could point me to the right direction in understanding this i would be grateful