UIClosures 是用 Swift 写成的 closure 库,用于 UIKit。
简单示例:
button.on(.TouchUpInside, (sender: AnyObject) -> () { let button = sender as! UIButton button.setTitle("Pressed", forControlState:.Normal) })