swift UITableView(四)
来源:互联网 发布:office办公软件 编辑:程序博客网 时间:2024/06/05 14:13
我们上一节主要讲了tableView设置每行显示的内容
继续使用上节代码(代码下载方式见第三节末尾)
以上几节简单了讲了如何使用tableView来现实内容。那么我们点击了tableView的某一行内容之后会如何操作
我们直接上一节的代码不管点击哪一行都可以看到他选中了
但是,没有任何方法执行
这里就需要实现一个UITableViewDelegate 的一个方法
- func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
- print("\(_dataArray[indexPath.row])")
- }
好了 我们执行一下 点击任意行看效果
是不是点击之后log 中打印出了 这一行的标题
0 0
- swift UITableView(四)
- Swift UITableView相关功能(四)点击操作
- swift UITableView(一)
- swift UITableView(二)
- swift UITableView(三)
- swift UITableView(五)
- swift UITableView(六)
- swift UITableView(七)
- swift UITableView(八)
- Swift ☞ UITableView(一)
- Swift基础(十六)UITableView
- UITableView(四)--- 实战
- swift uitableview
- swift UItableView
- UITableView --Swift
- 拾遗系列(四) UITableView
- swift之自定义表格控件(UITableView)
- 自学Swift(四)
- iOS修改UIWebView中的图片大小
- jquery(zepto) when then 使用
- LeetCode Majority Element
- Epoll
- ArcGIS教程:影响路径距离(水平系数)(二)
- swift UITableView(四)
- swift UITableView(五)
- Linux 格式化分区 报错Could not stat --- No such file or directory 和 partprobe 命令
- uva11997 K Smallest Sums
- 严重: Error configuring application listener of class org.springframework.web.context.ContextLoader
- UIButton的imageEdgeInsets和titleEdgeInsets属性 —— HERO博客
- cf(数学思维题)
- HOW TO: Find the Problem Exception Stack When You Receive an UnhandledExceptionFilter Call in the St
- swift UITableView(六)