swift UITableViewCell拷贝

前端之家收集整理的这篇文章主要介绍了swift UITableViewCell拷贝前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
  1. func tableView(tableView: UITableView,performAction action: Selector,forRowAtIndexPath indexPath: NSIndexPath,withSender sender: AnyObject?) {
  2. if action == Selector("copy:") {
  3. if let cell = tableView.cellForRowAtIndexPath(indexPath) as? JokeViewCell {
  4. UIPasteboard.generalPasteboard().string = cell.contentLabel.text
  5. }
  6. }
  7. }
  8.  
  9. func tableView(tableView: UITableView,canPerformAction action: Selector,forRowAtIndexPath indexPath: NSIndexPath,withSender sender: AnyObject?) -> Bool {
  10. return action == Selector("copy:")
  11. }
  12.  
  13. func tableView(tableView: UITableView,shouldShowMenuForRowAtIndexPath indexPath: NSIndexPath) -> Bool {
  14. return true
  15. }

猜你在找的Swift相关文章