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 }
相关文章推荐
- Swift入门基础概览
- Swift中类的操作
- iOS项目开发实战(Swift)—Button和Alert学习
- Swift 2.0 学习第4天:控制流
- Swift -3 函数和闭包
- swift中函数的类型
- c oc swift的冒泡排序
- Swift学习-基础数据类型
- swift2.1_Language Guide_Error Handling
- masonry oc版( snapkit swift版)
- Swift 2.0 学习第3天: 字典和数组
- Swift 2.0 学习第2天: 基 4000 本操作符
- Swift 2.0 学习第1天:常量和变量, 数据类型,字符和字符串
- iOS项目开发实战(Swift)—查询天气小应用
- swift 快速奔跑的兔几 本节的内容是:cocoa绑定
- Swift学习-单例
- SWIFT用ScrollView加图片制作Banner
- 《从零开始学Swift》学习笔记(Day 38)——构造函数与存储属性初始化
- iOS项目开发实战(Swift)—简单浏览器
- Swift 实现单例模式Singleton pattern的三种方法