Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show text in UILabel as secured in iphone [closed]

I'm using UILabel for displaying the year value which i select through UIPickerView. I want the year field to be secure. In UITextfield we will use setSecureTextEntry, do we have anything similar for UILabel?

Thanks

like image 302
Malathi Avatar asked Feb 21 '23 22:02

Malathi


1 Answers

I am not sure I really understand your question, but assuming you want to display asterisks in place of text in the label, just get the length of the string you would normally display and replace the characters with asterisks:

NSString *myPickerValue = @"MyPickerValue";
self.myLabel.text = [@"" stringByPaddingToLength: [myPickerValue length] withString: @"*" startingAtIndex:0];
like image 188
LJ Wilson Avatar answered Mar 04 '23 07:03

LJ Wilson