【发布时间】:2017-03-29 14:38:22
【问题描述】:
在文本字段中,我需要检测用户按 Enter(返回)键。委托方法与 UITextField 中的完全不同,所以不太确定该怎么做……我使用的是 swift 2.3 atm。
【问题讨论】:
标签: swift macos cocoa nstextfield swift2.3
在文本字段中,我需要检测用户按 Enter(返回)键。委托方法与 UITextField 中的完全不同,所以不太确定该怎么做……我使用的是 swift 2.3 atm。
【问题讨论】:
标签: swift macos cocoa nstextfield swift2.3
当用户点击 enter 键时委托方法
func controlTextDidEndEditing(_ aNotification : Notification)
被调用。
这是 Swift 3 的语法。输入 cont 并使用代码完成来获取 Swift 2 语法。
【讨论】: