When hooking Swift code up to a Storyboard, how do you add the IBAction
and IBOutlet
tags?
Add IBAction
and IBOutlet
attributes to variables and functions so they can be visible in Interface builder.
class ViewController: UIViewController {
@IBOutlet var label: UILabel?
@IBAction func doTap(x:UIButton) {
println("Tapped: \(x)")
}
}