TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Mar 2017 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ✗ |
Maintained by anatoliyv.
Like animation (heart beating):
willBegin
and didEnd
eventsTo run the example project, clone the repo, and run pod install
from the Example directory first to select best properties suitable for your project.
Swift 3 and iOS 9.0
LikeAnimation is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "LikeAnimation"
Create an animation.
let likeAnimation = LikeAnimation(frame: CGRect(origin: yourPlaceholderView, size: CGSize(width: 100, height: 100)))
Customize duration to 1.5 seconds.
likeAnimation.duration = 1.5
Customize particles counters.
likeAnimation.circlesCounter = 1 // One cirlce
likeAnimation.particlesCounter.main = 6 // 6 big particles
likeAnimation.particlesCounter.small = 7 // 7 particles between big particles
Customize colors if required. Default fill color is white for all elements.
likeAnimation.heartColors.initial = .white
likeAnimation.heartColors.animated = .orange
likeAnimation.particlesColor = .orange
Set delegate methods:
likeAnimation.delegate = self
in your delegate implementation
func likeAnimationWillBegin(view: LikeAnimation) {
print("Like animation will start")
}
func likeAnimationDidEnd(view: LikeAnimation) {
print("Like animation ended")
}
Run
likeAnimation.run()
LikeAnimation is available under the MIT license. See the LICENSE file for more info.