UITableView

1.去掉表格上方的空白

self.automaticallyAdjustsScrollViewInsets = false

2.返回上一页面数据刷新

将数据加载放入viewWillAppear方法中

3.跳转

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
    if segue.identifier == "projectToDetail" {
        if let vc = segue.destination as? ProjectIDetailViewController{
            let index = sender as! Int
            vc.project = self.projectList[index]
        }
    }
}

performSegue(withIdentifier: "projectToDetail", sender: indexPath.row)

4.判断单元格section的小办法

func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) {
    if tableView.isEditing && 3 ... 4 ~= indexPath.section {
        self.updateDeleteBarItemTitle()
    }
}

你可能感兴趣的:(UITableView)