There's an option in StoryBoard to set the Preferred Width
to automatic
How can this be achieved programmatically? I know that UILabel has a preferredMaxLayoutWidth
property, but how can I set to automatic?
There's an option in StoryBoard to set the Preferred Width
to automatic
How can this be achieved programmatically? I know that UILabel has a preferredMaxLayoutWidth
property, but how can I set to automatic?
there is a property in UILabel class
// Support for constraint-based layout (auto layout)
// If nonzero, this is used when determining -intrinsicContentSize for multiline labels
@property(nonatomic) CGFloat preferredMaxLayoutWidth NS_AVAILABLE_IOS(6_0);
if you will not set it will set automatically by default