Created
August 11, 2018 01:52
-
-
Save mildocjr/14e628b3479452d753910a67eca8290f to your computer and use it in GitHub Desktop.
type-cast-5
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
class CustomTableViewCell: UITableViewCell { | |
@IBOutlet weak var imageView: UIImageView! | |
@IBOutlet weak var title: UILabel! | |
@IBOutlet weak var subtitle: UILabel! | |
} | |
class TableView: UITableView { | |
func tableView(_ tableView: UITableView, | |
cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |
let cell = tableView.dequeueReusableCell(with: identifier) | |
as? CustomTableViewCell | |
cell.imageView.image = UIImage(named: "myAwesomeImage") | |
cell.title.text = "My facinating title" | |
cell.subtitle.text = "My even better subtitle" | |
return cell | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment