Skip to content

Instantly share code, notes, and snippets.

@dalu93
Last active March 14, 2017 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dalu93/ce2b8d66e4f06d9c51aeca5cd4220172 to your computer and use it in GitHub Desktop.
Save dalu93/ce2b8d66e4f06d9c51aeca5cd4220172 to your computer and use it in GitHub Desktop.
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