Skip to content

Instantly share code, notes, and snippets.

@vburojevic
Created April 26, 2016 20:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vburojevic/fa985fd5766673f062fc19ccbadd21b6 to your computer and use it in GitHub Desktop.
Save vburojevic/fa985fd5766673f062fc19ccbadd21b6 to your computer and use it in GitHub Desktop.
Swift
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
guard let items = items else {
return 0
}
return items.count
}
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
guard let item = items?[indexPath.row] else {
return
}
// Open item details
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment