1

在文本字段中,我需要检测用户按 Enter(返回)键。委托方法与 UITextField 中的完全不同,所以不太确定该怎么做......我使用 swift 2.3 atm。

4

1 回答 1

8

当用户enter击键时委托方法

func controlTextDidEndEditing(_ aNotification : Notification)

叫做。

这是 Swift 3 的语法。键入cont并使用代码完成来获取 Swift 2 语法。

于 2016-11-15T16:15:42.240 回答