In my app there is a textField where the user have to put is password in and i want that when he enter a character it change it to '•' how can i do this?
ベストアンサー1
You can achieve this directly in Xcode:
The very last checkbox, make sure secure
is checked .
または、コードを使用して実行することもできます:
テキスト オブジェクトが入力中のテキストを非表示にするかどうかを識別します。
宣言
optional var secureTextEntry: Bool { get set }
議論
このプロパティはfalse
デフォルトで に設定されています。このプロパティを に設定すると、true
パスワード スタイルのテキスト オブジェクトが作成され、入力中のテキストが非表示になります。
例:
texfield.secureTextEntry = true