Latest 1.0.1
Homepage https://github.com/acotilla91/ACAnimator
License MIT
Platforms ios 10.0, tvos 10.0
Authors

Version
License
Platform

ACAnimator lets you animate almost anything on iOS or tvOS (including non-animatable properties). Can also be used to "animate" logical changes not just visual (e.g. fade in/out audio). It supports over 30 different easing functions and it uses CADisplayLink for optimal performance.

Example

Demo

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

Usage

// A random element
let box = UIView(frame: CGRect(x: 0, y: 200, width: 40, height: 40))
box.backgroundColor = .red
view.addSubview(box)

// Determine the target value
let targetX = UIScreen.main.bounds.width - box.frame.width

// Prepare and run the animation
let animator = ACAnimator(duration: 3.0, easeFunction: .expoInOut, animation: { (fraction, _, _) in
    // Calculate the proper value for the current "frame"
    let newValue = targetX * CGFloat(fraction)

    // Apply the new value
    box.transform = CGAffineTransform(translationX: newValue, y: 0)

    // NOTE: the `transform` property is animatable through UIKit or CoreAnimation, this example just showcases the equivalent implementation using ACAnimator.
})
animator.start()

Installation

CocoaPods

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

pod 'ACAnimator'

Manual

Just drag the ACAnimator.swift file into your project.

Author

acotilla91, [email protected]

License

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

Latest podspec

{
    "name": "ACAnimator",
    "version": "1.0.1",
    "summary": "Animate anything on iOS or tvOS",
    "description": "ACAnimator lets you animate almost anything on iOS or tvOS (including non-animatable properties). Can also be used to "animate" logical changes not just visual (e.g. fade in/out audio). It supports over 30 different easing functions and it uses `CADisplayLink` for optimal performance.",
    "homepage": "https://github.com/acotilla91/ACAnimator",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Alejandro Cotilla": "[email protected]"
    },
    "source": {
        "git": "https://github.com/acotilla91/ACAnimator.git",
        "tag": "1.0.1"
    },
    "social_media_url": "https://twitter.com/acotilla91",
    "platforms": {
        "ios": "10.0",
        "tvos": "10.0"
    },
    "swift_version": "5.0",
    "source_files": "ACAnimator/Classes/**/*"
}

Pin It on Pinterest

Share This