anim

An animation library for iOS with custom easings and easy to follow API.

anim is an animation library written in Swift with a simple, declarative API in mind.

// moves box to 100,100 with default settings
anim {
    self.box.frame.origin = CGPoint(x:100, y:100)
}
// after that, waits 100 ms
.wait(0.1)
// moves box to 0,0 after waiting
.then {
    self.box.frame.origin = CGPoint(x:0, y:0)
}
// displays message after all animations are done
.callback {
    print("Just finished moving ? around.")
}

It supports a bunch of easing functions and chaining multiple animations. It's a wrapper on Apple's UIViewPropertyAnimator on its core, and falls back to UIView.animate on versions before iOS and tvOS 10. It uses NSAnimationContext on macOS.

Installation

Cocoapods

pod 'anim'

Carthage

github "onurersel/anim"

Manually

Or simply drag the swift files inside src/ folder into your project.

GitHub