我将IBOutlet和IBAction连接到我从Interface Builder到我的View Controller的按钮变量.如何在Swift中为按钮添加动作方法?
这段代码似乎不起作用.
原文链接:https://www.f2er.com/swift/320114.html这段代码似乎不起作用.
@IBOutlet var OK: UIButton! @IBAction func OK(sender: UIButton){}
我找到的Objective-C等价物是:
@interface Controller { IBOutlet id textField; // links to TextField UI object } - (IBAction)doAction:(id)sender; // e.g. called when button pushed