LikeAnimation 0.2.0

LikeAnimation 0.2.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Mar 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by anatoliyv.



Like Animation for iOS

LikeAnimation

Like animation (heart beating):

  • [x] Easy to add to your project
  • [x] Customizable colors
  • [x] Customizable particles
  • [x] Has delegation to handle willBegin and didEnd events

Example

To run the example project, clone the repo, and run pod install from the Example directory first to select best properties suitable for your project.

Requirements

Swift 3 and iOS 9.0

Installation

LikeAnimation is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "LikeAnimation"

Usage

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()

Author

License

LikeAnimation is available under the MIT license. See the LICENSE file for more info.