Obscure a UITextField password

IosSwiftIphoneSecurityIpad

Ios Problem Overview


I am doing a login page. I have UITextField for password.

Obviously, I do not want the password to be seen; instead, I want circles to show when typing. How do you set the field for this to happen?

Ios Solutions


Solution 1 - Ios

Please set your UItextField property secure..

Try this..

textFieldSecure.secureTextEntry = true

textFieldSecure is your UITextField...

Solution 2 - Ios

One can do this for Obscure a UITextField password:

enter image description here

CODE

Objective-C:

textField.secureTextEntry = YES;

Swift:

textField.isSecureTextEntry = true 

Solution 3 - Ios

In Interface Builder check the "Secure Text Entry" checkbox

or

In code set:

Objective-C:

yourTextField.secureTextEntry = YES;

Swift:

yourTextField.secureTextEntry = true

Solution 4 - Ios

Set the secureTextEntry property to YES.

Solution 5 - Ios

Open the Xib file and open the inspector of the password text field and tick the secure property.

Solution 6 - Ios

For Swift 3.0:

txtpassword.isSecureTextEntry = true

Solution 7 - Ios

in Swift 3.0 or later

passwordTextField.isSecureTextEntry = true

Solution 8 - Ios

Simply check Secure Text Entry check box on the storyboard

enter image description here

Solution 9 - Ios

txt_Password = new UITextField {
  Frame = new RectangleF (20,40,180,31),
  BorderStyle = UITextBorderStyle.Bezel,
  TextColor = UIColor.Black,
  SecureTextEntry = true,
  Font = UIFont.SystemFontOfSize (17f),
  Placeholder = "Enter Password",
  BackgroundColor = UIColor.White,
  AutocorrectionType = UITextAutocorrectionType.No,
  KeyboardType = UIKeyboardType.Default,
  ReturnKeyType = UIReturnKeyType.Done,
  ClearButtonMode = UITextFieldViewMode.WhileEditing,
};

secureTextEntry set true.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionharsh_017View Question on Stackoverflow
Solution 1 - IosMehul MistriView Answer on Stackoverflow
Solution 2 - IosShekhar GuptaView Answer on Stackoverflow
Solution 3 - IosiprabaView Answer on Stackoverflow
Solution 4 - IosjtbandesView Answer on Stackoverflow
Solution 5 - IosPgmFreekView Answer on Stackoverflow
Solution 6 - IossomnathView Answer on Stackoverflow
Solution 7 - IosNandkishor mewaraView Answer on Stackoverflow
Solution 8 - IosFangmingView Answer on Stackoverflow
Solution 9 - IoskiranView Answer on Stackoverflow