I have a UITextView
at the bottom of screen.
It has leading, trailing bottom space constraints to the superview
.
It has also height constraint with value (constant) 40
.
I want to make this text view of flexible height as I go on typing more text in it.
I can make flexible height by changing height constraint value to greater than or equal
to as:
It works fine and text view height goes on increasing.
But when I make it, storyboard show this error:
I want to make constraint value greater than or equal to programmatically, not from storyboard.
I know that there is one property of NSLayoutConstraint
called
public var relation: NSLayoutRelation { get }
but as we can see it is readonly.
How can I change this relation to one of:
public enum NSLayoutRelation : Int {
case LessThanOrEqual
case Equal
case GreaterThanOrEqual
}
Or is there any workaround make a view of flexible height in auto-layout based storyboard?
I know about making IBOutlet of constraint and changing it’s constant value, but in my situation I can not do this, it should be changed dynamically.