Skip to content
This repository has been archived by the owner on Mar 26, 2021. It is now read-only.

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

License

Notifications You must be signed in to change notification settings

hectr/DriftAnimationImageView

Repository files navigation

DriftAnimationImageView

Version License Platform

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.

Alternatives

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published