I have many shortcuts superimposed on the contact information screen. If any of the labels is empty, I would like to reset their height and not take up space in order to avoid empty space on the screen. However, I created the screen in the storyboard, and the labels were assigned the values of height and y.
Here is the code that I tried to use to change the height of the inscription, but I can not get it to work. Perhaps it is designed to work only for created programs, and the storyboard settings override what I'm doing here.
NSString *string = @"some text";
CGSize maximumLabelSize = CGSizeMake(280,1000);
CGSize expectedLabelSize = [string sizeWithFont:myLabel.font constrainedToSize:maximumLabelSize lineBreakMode:NSLineBreakByWordWrapping];
CGRect newFrame = myLabel.frame;
newFrame.size.height = expectedLabelSize.height;
myLabel.frame = newFrame;
Is there a way to get the height of labels created in the storyboard to zero if they are empty?