将 Swift 代码连接到 Storyboard 时,如何添加IBAction
and IBOutlet
tags?
Add IBAction
and IBOutlet
变量和函数的属性,以便它们在界面生成器中可见。
class ViewController: UIViewController {
@IBOutlet var label: UILabel?
@IBAction func doTap(x:UIButton) {
println("Tapped: \(x)")
}
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)