注意:我讀過this question on a similar topic,但那是兩年前的Objective-C。NSSecureTextField可以顯示明文嗎?
我有一個NSSecureTextField
其中用戶輸入一些文本。在我的代碼中的某個位置,我希望允許NSSecureTextField
顯示用戶在觸發NSButton
時以前輸入的確切文本。
示例代碼如下:
@IBOutlet var secureText: NSSecureTextField! // secure text field, with text
@IBAction func switchSecureDisplay(sender: NSButton) {
// here's where I would like to switch secure display to normal plaintext display.
// unfortunately, no such method exists
secureText.displayPlainText()
}
它是實現這種方法displayPlainText()
可行嗎?如果沒有,有沒有可能的替代解決方法?
@HAS'NSSecureTextField'已經沒有這樣的屬性,我用它作爲一個例子做對我的目標 – perhapsmaybeharry
你是對的,對不起! – HAS