DriftAnimationImageView 1.0.0

DriftAnimationImageView 1.0.0

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

Maintained by Héctor Marqués.




DriftAnimationImageView

Demo 0 Demo 1

Introduction

UIImageView subclass that performs slow translation and scale animations on its image.

You perform random translation and scale animations with beginDriftAnimations():

imageView.beginDriftAnimations()

You perform a custom animation by using the DriftAnimationTraits struct:

let traits = self.buildDriftAnimationTraits(imageView
    , repeats: true
    , zoomOut: false
    , minZoom: 1.0
    , maxZoom: 2.0
    , minPointsPerSec: 4
    , maxPointsPerSec: 5)
DriftAnimationImageView.addDriftAnimations(imageView, traits: traits, completion: nil)

You perform random translation and scale animations on a series of images with performDriftAnimations():

imageView.performDriftAnimations(["image0", "image1"])

You remove an ongoing animation with removeDriftAnimations():

imageView.removeDriftAnimations()

Usage

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

Installation

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

pod "DriftAnimationImageView"

License

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