When hooking Swift code up to a Storyboard, how do you add the IBAction
and IBOutlet
tags?
Below code shows IBOutlet and IBAction format in Swift :
class MyViewController: UIViewController {
@IBOutlet weak var btnSomeButton: UIButton?
@IBOutlet weak var lblLabelItem: UILabel?
@IBAction func btnSomeButtonClicked(sender: UIButton) {
...
}
}
You can bind them same way as done in Objective-C.