Skip to content

Instantly share code, notes, and snippets.

@ArchieR7
Last active December 5, 2018 00:42
Show Gist options
  • Save ArchieR7/509bda59f112840f0e0b9ace7c59ac06 to your computer and use it in GitHub Desktop.
Save ArchieR7/509bda59f112840f0e0b9ace7c59ac06 to your computer and use it in GitHub Desktop.
struct CustomTableViewCellModel {
let title: String
let content: String?
}
class CustomTableViewCell: UITableViewCell {
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var contentTextView: UITextView!
var viewModel: CustomTableViewCellModel? {
didSet {
guard let viewModel = viewModel else { return }
titleLabel.text = viewModel.title
contentTextView.text = viewModel.content
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment