class ViewController: UIViewController {
@IBAction func btn_click(sender : AnyObject) {
println("click");
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
开发起来和OC一样,将btn的单击事件拖拽到 class 里面。