Skip to content

Instantly share code, notes, and snippets.

@apatronl
Created June 20, 2020 17:19
Show Gist options
  • Save apatronl/9796bf1e3a63c64434dc7a57e71b8638 to your computer and use it in GitHub Desktop.
Save apatronl/9796bf1e3a63c64434dc7a57e71b8638 to your computer and use it in GitHub Desktop.
import UIKit
class HeartButton: UIButton {
private let unlikedImage = UIImage(named: "heart_empty")
private let likedImage = UIImage(named: "heart_filled")
override public init(frame: CGRect) {
super.init(frame: frame)
setImage(unlikedImage, for: .normal)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment