Reputation: 126507
What's the difference between a UITextField
's rectangle for its text vs. editable text?
I just want to move where the text is displayed inside the text field. Should I just override both methods with the same exact implementation?
Returns the drawing rectangle for the text field’s text.
Returns the rectangle in which editable text can be displayed.
Upvotes: 9
Views: 7251
Reputation: 126507
textRectForBounds:
lets you set the rectangle for the text when the text field is not being edited.
editingRectForBounds:
lets you set the rectangle for the text when the text field is being edited.
So, yes, you should implement both with the same exact implementation unless you want the text to jump when you begin & end editing.
Upvotes: 28