P
P
Pavel Makukha2014-12-01 07:24:05
Objective-C
Pavel Makukha, 2014-12-01 07:24:05

How to display stars instead of dots in textField with SecureTextEntry in Objective C?

ccb0849507454627917354faf98170d7.png
The standard display of secure text looks like bold dots.
By design, you need to display the stars.
Can this be done with 1 field without shamanism with an additional hidden field?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
An, 2014-12-22
@marsohod

1) Override the delegate method
-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
, take the replacementString in it and combine it with what the user previously entered + backspace processing. At the same time, insert the required number of stars into the textField
2) use a custom font in which to re-render the symbol 'BULLET' (U+2022) (see the answer here
3) Break the hands of someone who requires any garbage, such as asterisks in the secure input field. What did not please them with the standard apple'ovsky

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question