How do you use Interface builder with Swift?
interface-builder, swift, xcode-storyboard
Solution
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)")
}
}
Problem
When hooking Swift code up to a Storyboard, how do you add the `IBAction` and `IBOutlet` tags?