您的位置:首页 > 移动开发 > Swift

swift UITableViewCell拷贝

2015-11-21 00:15 429 查看
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
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: