Skip to content

Commit

Permalink
Add animation back
Browse files Browse the repository at this point in the history
  • Loading branch information
lucoceano committed Apr 12, 2016
1 parent ba3eb60 commit d538cf8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class ViewController: UIViewController {
if sender.selected {
sender.deselect()
} else {
sender.select()
sender.selectAnimated()
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion DOFavoriteButton.podspec
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
6 changes: 5 additions & 1 deletion DOFavoriteButton/DOFavoriteButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit d538cf8

Please sign in to comment.