Skip to content

Instantly share code, notes, and snippets.

@akimach
Created June 8, 2016 11:43
Show Gist options
  • Select an option

  • Save akimach/734db00eb3890b8deddcb35568e2eec2 to your computer and use it in GitHub Desktop.

Select an option

Save akimach/734db00eb3890b8deddcb35568e2eec2 to your computer and use it in GitHub Desktop.

UITableViewDataSource Protocol

  • func numberOfSectionsInTableView(tableView: UITableView) -> Int
  • セクション数
  • func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int
  • セクションごとのセル数
  • func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String?
  • セクション名
  • func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
  • セルの内容
  • func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool
  • 削除可能なセル
  • func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath)
  • 削除の処理
  • func tableView(tableView: UITableView, canMoveRowAtIndexPath indexPath: NSIndexPath) -> Bool
  • 並び替え可能
  • func tableView(tableView: UITableView, moveRowAtIndexPath sourceIndexPath: NSIndexPath, toIndexPath destinationIndexPath: NSIndexPath)
  • 並び替えの処理

UITableViewDelegate Protocol

  • func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath)
  • セルがタップされた
  • func tableView(tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat
  • テーブル上部の余白
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment