Skip to content

Instantly share code, notes, and snippets.

@Nicholas-Swift
Last active January 25, 2017 07:58
Show Gist options
  • Save Nicholas-Swift/dc8ad273625e6ed640a71f6d1d2bbcb7 to your computer and use it in GitHub Desktop.
Save Nicholas-Swift/dc8ad273625e6ed640a71f6d1d2bbcb7 to your computer and use it in GitHub Desktop.
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