I have a UITextField that I'd like to add a "?" suffix to all text entered.
The user should not be able to remove this "?" or add text to the right hand side of it.
What's the best way to go about this?
I have a UITextField that I'd like to add a "?" suffix to all text entered.
The user should not be able to remove this "?" or add text to the right hand side of it.
What's the best way to go about this?
You'll probably need to subclass UITextField and override its
drawText:
method to draw an additional "?" character to the right of the actual text. (Rather than actually add a "?" to the text of the view.I would add a method that is called when edit finishes:
I had this issue and I wrote a subclass to add this functionality: https://github.com/sbaumgarten/UIPlaceholderSuffixField. Hopefully you have found a solution by now but if you haven't, this should work.