0

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?

Harry Blue
  • 4,202
  • 10
  • 39
  • 78

1 Answers1

3

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

This should achieve what you are looking for.

enter image description here

nodediggity
  • 2,458
  • 1
  • 9
  • 12
  • I think this is meant to be a *Size* in IB's User Defined Runtime Attribute. Rect will technically work but it's internally doing a hard C-style cast from a `CGRect` to `CGSize` (with the `origin` ending up being used as the `CGSize`), so not a good idea. – Slipp D. Thompson Dec 20 '22 at 08:18