&tag(UIKit/テーブル/Tips);
override func viewDidLoad() {
super.viewDidLoad()
self.tableView.contentInset = UIEdgeInsets(top: 20, left: 0, bottom: 0, right: 0)
self.tableView.backgroundColor = UIColor.grayColor()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
if let indexPath = tableView.indexPathForSelectedRow {
tableView.deselectRow(at: indexPath, animated: animated)
}
for cell in tableView.visibleCells {
}
}
Table Viewを作成したり管理したりするには、UITableViewControllerのサブクラスのインスタ ンスを使用します
管理対象のビューが合成ビューで、その中の複数のサブビューの1つがTable Viewの場合は、そのTable View(およびその他のビュー)を管理するために、UIViewControllerのカスタムサブクラスを使用 する必要があります。このコントローラクラスは、Table Viewをナビゲーションバーとタブバー(ど ちらかが存在する場合)の間の画面一杯に表示するため、UITableViewControllerを使用してはい けません。