Last active
January 25, 2017 07:58
-
-
Save Nicholas-Swift/dc8ad273625e6ed640a71f6d1d2bbcb7 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
class BestTableViewCell: UITableViewCell { | |
// MARK: - Instance Vars | |
@IBOutlet weak var mainStackView: UIStackView! | |
@IBOutlet weak var titleLabel: UILabel! | |
@IBOutlet weak var mainImageView: UIImageView! | |
@IBOutlet weak var bodyLabel: UILabel! | |
// MARK: - View Lifecycle | |
override func awakeFromNib() { | |
super.awakeFromNib() | |
styleSetup() | |
} | |
override func prepareForReuse() { | |
super.prepareForReuse() | |
mainImageView.af_cancelImageRequest() // NOTE: - Using AlamofireImage | |
mainImageView.image = nil | |
} | |
} | |
// MARK: - Setup | |
extension BestTableViewCell { | |
func styleSetup() { | |
mainImageView.layer.borderWidth = 0.5 | |
mainImageView.layer.borderColor = UIColor.lightGray.cgColor | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment