I want a '$' Sign in the text field which cannot be erased. A user should be able to enter values after it and if he presses backspace it should only erase the value he entered.
The reason I can't use UILabel before it is because the text in UITextfield is center aligned and it grows to either side as the user enters values.
Please provide any solution.
-textField:shouldChangeCharactersInRange:replacementString:
and return NO
if the proposed change would delete the "$".Also, you might need to implement -textFieldDidBeginEditing:
to position the cursor after the "$" if it's not there already.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With