Skip to content

Instantly share code, notes, and snippets.

@jkatayama
Created February 9, 2016 22:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkatayama/e210df29529865f6b437 to your computer and use it in GitHub Desktop.
Save jkatayama/e210df29529865f6b437 to your computer and use it in GitHub Desktop.

When you create a tableCell object for each row all you have to do is call dequeueReusableCellWithIdentifier on your tableView object. But this approach is only aviable when you work with storyboar. If you want to use a fully code-based cell class and one from .xib file, you need to register these identifiers to your tableView object.

Your tableViewCell is not on a tableView in storyboard and is initizlied progmatically

self.tableView.registerClass(<YourCellClass.self, forCellReuseIdentifier: "Cell")

Your tableViewCell is not on a tableView in storyboard but on xib file

tableView.registerNib(<#T##nib: UINib?##UINib?#>, forCellReuseIdentifier: <#T##String#>)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment