我正在尝试在我的表格 View 中添加一些编辑操作。但是,我不知道要为 UITableViewRowAction! 添加什么内容。它在代码中表示为IDK。
func Done(UITableViewRowAction!,
NSIndexPath!) -> Void {
}
override func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [AnyObject]? {
let complete = UITableViewRowAction(style: UITableViewRowActionStyle.Default, title: "Done", handler: Done(_IDK_, indexPath))
let arrayofactions: Array = [complete]
return arrayofactions
}
最佳答案
func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [AnyObject]? {
let delete = UITableViewRowAction(style: .Normal, title: "Delete") { action, index in
println("delete")
}
let done = UITableViewRowAction(style: .Default, title: "Done") { action, index in
println("done")
}
return [delete, done]
}
关于ios - 快速 editActionsForRowAtIndexPath,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26206358/