How to show text in UILabel as secured in iphone
I am using UILabel
to display the value of the year which I select through UIPickerView
. I want the field of the year to be safe. In UITextfield
we will be using setSecureTextEntry
, do we have anything similar for UILabel
?
thank
Why don't you just display your UILabel with * ? I don't understand why you need to make the shortcut "safe" when you control what is displayed.
I'm not sure if I really understand your question, but assuming you want to display asterisks instead of text in the label, just enter the length of the string you normally show and replace the characters with asterisks:
NSString *myPickerValue = @"MyPickerValue";
self.myLabel.text = [@"" stringByPaddingToLength: [myPickerValue length] withString: @"*" startingAtIndex:0];