Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mhijack/adc5465a7f6b334c6d7ee80350fd73cf to your computer and use it in GitHub Desktop.
Save mhijack/adc5465a7f6b334c6d7ee80350fd73cf to your computer and use it in GitHub Desktop.
extension HomeOptionsManager: UITableViewDataSource, UITableViewDelegate {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return options.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
cell.textLabel?.text = options[indexPath.row]
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return TABLE_CELL_HEIGHT
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
didSelectOption?(options[indexPath.row])
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment