Last active
August 11, 2017 13:54
-
-
Save serhatsezer/4d02dae2641e19346907d6c68cc65fd0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // Here we are creating representables for to take advantage of all representables. | |
| typealias Representables = protocol<TextPresentable, SwitchPresentable, ImagePresentable> | |
| class ProductListCell: UITableViewCell { | |
| @IBOutlet private weak var label: UILabel! | |
| @IBOutlet private weak var switch: UISwitch! | |
| @IBOutlet private weak var imageView: UIImageView! | |
| func configure(presenter: Representables) { | |
| label.text = presenter.text | |
| switch.on = presenter.switchOn | |
| imageView.image = UIImage(named: presenter.imageName) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment