UITextView variable, allow to set text using special method only?

180 Views Asked by At

I have a UITextField property inside a UIViewController class. I want to allow to set its text using a special method in view controller only. The goal is to move other view controller's elements according to a size of a text inside the text field.

Text field has editing option disabled so it can be setted in code only.

Way 1:

Subclass a UITextField. Looks too extra because I need to set the elements which doesn't belong to this text field. So I need to use a delegate (and as I understand it will be my own delegate only) etc.

Way 2:

Make text field property private. It is my current solution but I don't like that it is fully private.

Can anybody advice a better solution?

0

There are 0 best solutions below