MinuteAnimations 0.0.2

MinuteAnimations 0.0.2

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

Maintained by Luca Gobbo.



MinuteAnimations

Simplfy animations with some sugar. This is a small library i personally use for my projets at my work.

inspired by this medium post

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Animator Examples

  constraint.constant = 100
  UIView.Animator(duration: animation.duration)
    .animations { self.view.layoutIfNeeded() }
    .animate()
  constraint.constant = 100
  UIView.Animator(duration: animation.duration)
    .animations { self.view.layoutIfNeeded() }
    .completion { self.animationCompleted() }
    .animate()

KeyFrameAnimator example

  UIView.KeyFrameAnimator(duration: 0.6)      
    .addAnimation(relativeStartTime: 0, relativeDuration: 0.5) {        
      label.alpha = 0
      button.transform = CGAffineTransform.identity.scaledBy(x: 0.1, y: 0.1)
    }
    .addAnimation(relativeStartTime: 0.5, relativeDuration: 0.3) {
      imageView.transform = CGAffineTransform.identity.scaledBy(x: 1.2, y: 1.2)
      imageView.alpha = 1
    }
    .addAnimation(relativeStartTime: 0.8, relativeDuration: 0.2) {
      imageView.transform = CGAffineTransform.identity
    }
    .animate()

Requirements

Installation

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

pod "MinuteAnimations"

Author

Luca Gobbo, [email protected]

License

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