Created
April 23, 2019 11:58
-
-
Save ashour/9a279008924b4641b6641871d143155e 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
import UIKit | |
import SDWebImage | |
class FeedTableViewCell: UITableViewCell | |
{ | |
@IBOutlet weak var productNameLabel: UILabel! | |
@IBOutlet weak var storeNameLabel: UILabel! | |
@IBOutlet weak var discountLabel: UILabel! | |
@IBOutlet weak var expiryLabel: UILabel! | |
@IBOutlet weak var priceAfterDiscountLabel: UILabel! | |
@IBOutlet weak var priceBeforeDiscountLabel: UILabel! | |
@IBOutlet weak var productImageView: UIImageView! | |
func updateUI(with product: Product) | |
{ | |
productNameLabel.text = product.name | |
storeNameLabel.text = product.store.localizedUppercase | |
discountLabel.text = product.discount.localizedUppercase | |
expiryLabel.text = | |
String(format: __("expires"), product.expires).localizedUppercase | |
priceAfterDiscountLabel.text = product.priceAfterDiscount | |
priceBeforeDiscountLabel.attributedText = | |
strikeThrough(product.priceBeforeDiscount) | |
productImageView.sd_setImage(with: URL(string: product.imageUrl)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment