diff --git a/DOFavoriteButton-DEMO/DOFavoriteButton-DEMO/ViewController.swift b/DOFavoriteButton-DEMO/DOFavoriteButton-DEMO/ViewController.swift index 65492c8..93dd915 100644 --- a/DOFavoriteButton-DEMO/DOFavoriteButton-DEMO/ViewController.swift +++ b/DOFavoriteButton-DEMO/DOFavoriteButton-DEMO/ViewController.swift @@ -64,7 +64,7 @@ class ViewController: UIViewController { if sender.selected { sender.deselect() } else { - sender.select() + sender.selectAnimated() } } } diff --git a/DOFavoriteButton.podspec b/DOFavoriteButton.podspec index dcb0f4a..9183a94 100644 --- a/DOFavoriteButton.podspec +++ b/DOFavoriteButton.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "DOFavoriteButton" - s.version = "0.0.5" + s.version = "0.0.6" s.summary = "Cute Animated Button written in Swift. It could be just right for favorite buttons!" s.homepage = "https://github.com/okmr-d/DOFavoriteButton" s.screenshots = "https://raw.githubusercontent.com/okmr-d/okmr-d.github.io/master/img/DOFavoriteButton/demo.gif" diff --git a/DOFavoriteButton/DOFavoriteButton.swift b/DOFavoriteButton/DOFavoriteButton.swift index 3167419..a3cedcf 100644 --- a/DOFavoriteButton/DOFavoriteButton.swift +++ b/DOFavoriteButton/DOFavoriteButton.swift @@ -362,8 +362,12 @@ public class DOFavoriteButton: UIButton { func touchCancel(sender: DOFavoriteButton) { self.layer.opacity = 1.0 } + + public func selectAnimated(){ + self.select(animated: true) + } - public func select() { + public func select(animated animated: Bool) { selected = true imageShape.fillColor = imageColorOn.CGColor