Hide password with “•••••••” in a textField

前端 未结 7 1857
时光说笑
时光说笑 2020-12-23 02:20

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?

相关标签:
7条回答
  • 2020-12-23 03:23

    In XCode 6.3.1, if you use a NSTextField you will not see the checkbox for secure.

    Instead of using NSTextField use NSSecureTextField

    https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSSecureTextField_Class/index.html

    I'm guessing this is a Swift/Objective-C change since there is now a class for secure text fields. In the above link it says Available in OS X v10.0 and later. If you know more about when/why/what versions of Swift/Objective-C, XCode, or OS X this

    0 讨论(0)
提交回复
热议问题