UITableView
iOS开发Swift-UITableView-navigationController?.pushViewController(fileOperation, animated: true)
navigationController?.pushViewController(fileOperation, animated: true) 通过导航控制器(navigationController)将一个新的视图控制器(fileOperation)推入栈顶,同时以动画的形式展示这个过程。如果na ......
iOS开发Swift-UITableView-tableView.deselectRow(at: indexPath, animated: true)
tableView.deselectRow(at: indexPath, animated: true) 作用:在表视图(UITableView)中取消选中某一行。 在表格视图中,用户可以点击或轻击一行来选中它。如果你想要在程序中取消选中这一行,就可以使用deselectRow(at:indexPa ......
iOS开发Swift-UITableView-tableView.dequeueReusableCell(withIdentifier: cellID, for: indexPath)
tableView.dequeueReusableCell(withIdentifier: cellID, for: indexPath) 作用:复用cell.可以用标识符从表视图中获得可重用单元格.for: indexPath通过指定单元格位置获得可重用单元格,不需要判断. ......
iOS开发Swift-UITableView-func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cellid = "testCellID" //cell的ID var cell = tableV ......
iOS开发Swift-UITableView-func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return 6 } 返回一个整形. 作用: UITableView的DataSource,用来确定cell的个数.number ......