Skip to content

Instantly share code, notes, and snippets.

@jimmythai
Created June 19, 2018 06:00
Show Gist options
  • Select an option

  • Save jimmythai/9a07fcbf82860a1ea4214832dac2cefa to your computer and use it in GitHub Desktop.

Select an option

Save jimmythai/9a07fcbf82860a1ea4214832dac2cefa to your computer and use it in GitHub Desktop.
// In SomeTableViewCell.swift
class SomeTableViewCell: UITableViewCell, Reusable {
override init(frame: CGRect) {
super.init(frame: frame)
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder: ) has not been implemented")
}
}
// In SomeTableView.swift
override func viewDidLoad() {
super.viewDidLoad()
tableView.register(SomeTableViewCell.self)
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
return tableView.dequeueReusableCell(SomeTableViewCell.self)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment