我将IBOutlet和IBAction连接到我从Interface Builder到我的View Controller的按钮变量.如何在Swift中为按钮添加动作方法?
这段代码似乎不起作用.
这段代码似乎不起作用.
@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