LoginSignup
0
0

More than 5 years have passed since last update.

Swift TableViewデータソース

Posted at

TableViewデータソース


  enum xxSection: Int {
    case XXX = 0
  }

  var tableView: UITableView!

  func setupDataSource() {
    self.tableView.register(UINib(nibName: "", bundle: nil), forCellReuseIdentifier: "")
  }

  func numberOfSections(in tableView: UITableView) -> Int {
    return 0
  }

  func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    return 0
  }

  func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
    return 44
  }

  func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCell(withIdentifier: "") as! ClassName
    return cell
  }

  func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {

  }

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0