Latest1.1.0
Homepagehttps://github.com/truffls/view-transformers-ios
LicenseMIT
Platformsios 9.0, requires ARC

alt text

Swift Version
Platform Compatibility
Pod version

ViewTransformers lets you pass multiple view transformations as an array to UIView.

Install via Cocoapods

Add following to your Podfile:

use_frameworks!
pod 'ViewTransformers'

How to use

You can easily pass multiple view transformations to a UIView by using the transforms property on UIView.

view.transforms = [
    CGAffineTransform(scaleX: 0.5, y: 0.5),
    CGAffineTransform(rotationAngle: -1.42),
    CGAffineTransform(translationX: 100, y: -145)
]

Reading the transforms property only returns the merged transformations as one in a one-item-array.

Example

alt text

Used code for the example:

func playAnimation() {
    UIView.animate(withDuration: 1.0, delay: 1.0, options: .curveLinear, animations: {
        self.myView.transforms = [
            CGAffineTransform(scaleX: 0.5, y: 0.5),
            CGAffineTransform(rotationAngle: -1.42),
            CGAffineTransform(translationX: 100, y: -145)
        ]
    }, completion: { _ in
        UIView.animate(withDuration: 1.0, delay: 1.0, options: .curveLinear, animations: {
            self.myView.transforms = nil
        }, completion: { _ in
            self.playAnimation()
        })
    })
}

Contribution

Issues and pull requests are welcome!

Latest podspec

{
    "name": "ViewTransformers",
    "version": "1.1.0",
    "summary": "ViewTransformers lets you pass multiple transformations as an array to the UIView.",
    "authors": "Truffls GmbH",
    "license": {
        "type": "MIT"
    },
    "homepage": "https://github.com/truffls/view-transformers-ios",
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/truffls/view-transformers-ios.git",
        "tag": "1.1.0"
    },
    "source_files": "Pod/**/*.swift",
    "ios": {
        "frameworks": [
            "UIKit",
            "CoreGraphics"
        ]
    },
    "requires_arc": true
}

Pin It on Pinterest

Share This