Last active
June 11, 2018 20:21
-
-
Save acecilia/214e60f75fc0d217810e29e51421c111 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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