Skip to content

Instantly share code, notes, and snippets.

@acecilia
Last active June 11, 2018 20:21
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 acecilia/214e60f75fc0d217810e29e51421c111 to your computer and use it in GitHub Desktop.
Save acecilia/214e60f75fc0d217810e29e51421c111 to your computer and use it in GitHub Desktop.
override func viewDidLoad() {
super.viewDidLoad()
tableView.register(CustomCell.self, forCellReuseIdentifier: "Cell")
}
func tableView(_ tableView: UITableView,
cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(
withIdentifier: "Cell", for: indexPath) as? CustomCell
cell.customLabel?.text = "Title" // ERROR: Value of optional type 'CustomCell?' not unwrapped
return cell // ERROR: Value of optional type 'CustomCell?' not unwrapped
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment