Skip to content

Instantly share code, notes, and snippets.

@zafarivaev
Last active January 14, 2020 17:55
Show Gist options
  • Save zafarivaev/69b139465ce131e81a1cb1f1d6852e27 to your computer and use it in GitHub Desktop.
Save zafarivaev/69b139465ce131e81a1cb1f1d6852e27 to your computer and use it in GitHub Desktop.
import UIKit
class CountryTableViewCell: UITableViewCell {
// MARK: - Initialization
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
// MARK: - Properties
var viewModel: CountryViewModel! {
didSet {
self.configure()
}
}
.....
}
// MARK: - Configuration
extension CountryTableViewCell {
func configure() {
countryNameLabel.text = viewModel.name
}
}
.....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment