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 returnNOif 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.