動作および画面上のCellにios Table Viewを出力するために必要な最小限の実装方法について説明する.


動作および画面のセルにTable Viewを出力するために必要な最小限の実装方法について説明する。


Table View:類似ユニットの下の画面ex):電話帳
1つのユニットが電話番号であればいいです.
セルを画面に出力するには、少なくとも実装するデータ・ソース・メソッドが必要です.
  • NumberOfRowsInSelection:セクションの行数を返す関数です.
  • CellForRowAt:テーブルビューで、特定の場所に挿入するセルを要求するデータソース
  • .
    func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: IndexPath) -> UITableViewCell // return a cell ie UITableViewCell 
    func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int // return a number ie an Int 
    func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? // return the title ie a String