iosswiftinterface-builderuiedgeinsets

Setting content insets on UITextView using XIB


I have a UITableViewCell which contains a UITextView.

I'd like to set padding on this text view, so that the cell content is pushed in by 10 on each side.

I understand I can do this in code using textView.textContainerInset = UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10)

Is this possible using the IB when working with a XIB file?


Solution

  • You can set a Key Path using a type of Rect.

    This should achieve what you are looking for.

    enter image description here