Last active
March 14, 2017 14:35
-
-
Save dalu93/ce2b8d66e4f06d9c51aeca5cd4220172 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
protocol TwoLinesAndImageDisplayable { | |
var imageURL: URL { get } | |
var topLineText: String { get } | |
var bottomLineText: String { get } | |
} | |
final class TwoLinesAndImageTableViewCell: UITableViewCell { | |
@IBOutlet fileprivate weak var _sideImageView: UIImageView! | |
@IBOutlet fileprivate weak var _topLabel: UILabel! | |
@IBOutlet fileprivate weak var _bottomLabel: UILabel! | |
func set<Item: TwoLinesAndImageDisplayable>(_ item: Item) { | |
_sideImageView.imageURL = item.imageURL | |
_topLabel.text = item.topLineText | |
_bottomLabel.text = item.bottomLineText | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment