Awesome Open Source
Awesome Open Source


Version License Platform Carthage compatible Xcode 8.2+ iOS 8.0+


Mystique wraps CoreAnimation with a nicer syntax to help you build up awesome animations (Swift version).



To implement above layer effect, all you need to write down:

// Animate the radiations
[radiation mt_startAnimations:^(MTAnimator *animate) {
} completion:^{
    [radiation removeFromSuperlayer];

// Animate the background circle
[circle mt_startAnimations:^(MTAnimator *animate) {
        .byValues(@[@0.8, @(scale), @(scale)])
        .during(@[@0.0, @0.5, @1.0])
} completion:^{
    [circle removeFromSuperlayer];

Check out the Mystique iOS Examples to get more details.



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

pod "Mystique"


You can also use Carthage to install Mystique by adding that to your Cartfile:

github "gbammc/Mystique"

Getting started

Basic usage

// Compose your animations in here.
[view mt_startAnimations:^(MTAnimator *animate) {

    // Animate origin x to 100 in 1s.;

    // Animate backgroundColor to red in 0.4s then change to yellow after 0.2s delay.
        .to([UIColor redColor]).after(0.4)
        .delay(0.2).to([UIColor yellowColor]).animate(0.4);


Basic attributes

Attribute keyPath
bounds bounds
size bounds.size
origin position
center position
x position.x
y position.y
width bounds.size.width
height bounds.size.height
opacity opacity
backgroundColor backgroundColor
borderColor borderColor
borderWidth borderWidth
cornerRadius cornerRadius
anchor anchorPoint
path position

Advance attributes

Attribute keyPath Description
scale transform.scale Idempotent
scaleX transform.scale.x Idempotent
scaleY transform.scale.y Idempotent
rotateX transform.rotation.x Accept degree value. Idempotent
rotateY transform.rotation.y Accept degree value. Idempotent
rotateZ transform.rotation.z Accept degree value. Idempotent
rotate transform.rotation.z The same as rotateZ
xOffset position.x Increase / decrease origin x by specific value
yOffset position.y Increase / decrease origin y by specific value
heightOffset bounds.size.width Increase / decrease width by specific value
widthOffset bounds.size.height Increase / decrease height by specific value
rotateOnPath position Animating along paths rotate to match the path tangent
reverseRotateOnPath position Animating along paths rotate to match the path tangent and auto reverse
fillColor fillColor CAShapeLayer only
strokeColor strokeColor CAShapeLayer only
strokeStart strokeStart CAShapeLayer only
strokeEnd strokeEnd CAShapeLayer only
lineWidth lineWidth CAShapeLayer only
miterLimit miterLimit CAShapeLayer only
lineDashPhase lineDashPhase CAShapeLayer only

Chaining Animations

An attribute should ended by animate(duration) function.

To chain an attribute with different values in different time can call after(duration) function.

To delay an animation call the delay(duration) function.

// it will disappear in one second and appear again after two second delay

Repeat and autoreverse

To repeat or autoreverse animations with the repeat(times), repeatInfinity() and autoreverse() functions.

Use it like CAKeyframeAnimation

Below is an example of how to set values and key times like CAKeyframeAnimation.

    .byValues(@[ @0.0, @1.1, @1.0 ])
    .during(@[ @0.0, @0.5, @1.0 ])

/* the same as:
CAKeyframeAnimation *keyframeAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
keyframeAnimation.values = @[ @0.0, @1.1, @1.0 ];
keyframeAnimation.keyTimes = @[ @0.0, @0.5, @1.0 ];
keyframeAnimation.duration = duration;


Set logEnable to YES will print all animations details for you to debug.

animate.logEnable = YES


Thanks their incredible works!




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

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
objective-c (10,816
animation (1,041
carthage (323
coreanimation (21

Find Open Source By Browsing 7,000 Topics Across 59 Categories