Skip to content

Instantly share code, notes, and snippets.

@Eluss
Created January 31, 2016 10:58
Show Gist options
  • Save Eluss/4e9734142e61bf038548 to your computer and use it in GitHub Desktop.
Save Eluss/4e9734142e61bf038548 to your computer and use it in GitHub Desktop.
func performHeartBeat(sender: UIButton) {
let imageView = UIImageView(frame: self.heartButton.frame)
imageView.image = UIImage(named: "heart_border")
self.view.addSubview(imageView)
UIView.animateWithDuration(0.5, animations: { () -> Void in
imageView.transform = CGAffineTransformMakeScale(3,3)
imageView.alpha = 0
}) { (completed) -> Void in
imageView.removeFromSuperview()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment