viewController (IBAction) ctrl-drag, ( ), Swift ( ):
@IBAction func buttonAction() {}
objective-C :
- (IBAction)buttonAction {}
, , @IBAction func OK(sender: UIButton){} - .
, SO.
:
, , IBOutlet IBAction, , IBAction, , , :
@IBOutlet var OK: UIButton!
@IBAction func OK(sender: UIButton){}
, , viewDidLoad
OK.hidden = true
OK , " " , :
@IBAction func OK(sender: UIButton){
println("You pressed me")
}
" " .
:
Swift 2.0 , println print. , , , , - :
@IBOutlet var okOutlet: UIButton!
@IBAction func okAction(sender: UIButton){}
, , , ..