Skip to content

Instantly share code, notes, and snippets.

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