标签:anim ack efault images 定制 throw for 技术 ges
UITableViewRowAction类
object defines a single action to present when the user swipes horizontally in a table
style: UITableViewRowActionStyle
default
和normal
效果如上图title: String?
backgroundColor: UIColor?
按钮的颜色convenience init(style: UITableViewRowActionStyle, title: String?, handler: (UITableViewRowAction, IndexPath) -> Void)
handler即使点击时调用的方法。
初始化UITableViewRowAction
let action1 = UITableViewRowAction.init(style: .Normal, title: "normal") { (action, path) in
}
let action2 = UITableViewRowAction.init(style: .Default, title: "default") { (action, path) in
self.titles.removeAtIndex(0)
self.tableView?.deleteRowsAtIndexPaths([path], withRowAnimation: .Fade)
}
self.actions.insert(action1, atIndex: 0)
self.actions.insert(action2, atIndex: 1)
```
实现代理方法
func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [UITableViewRowAction]? {
return self.actions
}
标签:anim ack efault images 定制 throw for 技术 ges
原文地址:http://www.cnblogs.com/huahuahu/p/UITableView-ding-zhi-zuo-hua-xiao-guo.html