func tableView(tableView: UITableView, performAction action: Selector, forRowAtIndexPath indexPath: NSIndexPath, withSender sender: AnyObject?) {
if action == Selector("copy:") {
if let cell = tableView.cellForRowAtIndexPath(indexPath) as? JokeViewCell {
UIPasteboard.generalPasteboard().string = cell.contentLabel.text
}
}
}
func tableView(tableView: UITableView, canPerformAction action: Selector, forRowAtIndexPath indexPath: NSIndexPath, withSender sender: AnyObject?) -> Bool {
return action == Selector("copy:")
}
func tableView(tableView: UITableView, shouldShowMenuForRowAtIndexPath indexPath: NSIndexPath) -> Bool {
return true
}
swift UITableViewCell拷贝
最新推荐文章于 2022-02-16 18:59:17 发布