Created
October 27, 2017 12:32
-
-
Save KaneCheshire/b0c4c1fbd4def32a5e1c082c12438686 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
final class Cell: UICollectionViewCell { | |
@IBOutlet private var titleLabel: UILabel! | |
@IBOutlet private var subtitleLabel: UILabel! | |
@IBOutlet private var actionLabel: UILabel! | |
func configure(with viewModel: CellViewModel) { | |
// Populate labels with the view model like always | |
self.titleLabel.text = viewModel.titleString | |
self.subtitleLabel.text = viewModel.subtitleString | |
self.actionLabel.text = viewModel.actionString | |
// Call the function in the UIView extension which knows | |
// how to use models that conform to `AccessibilityModel` | |
updateAccessibility(with: viewModel) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment