All Projects → gbammc → Mystique

gbammc / Mystique

Licence: mit
A wrapper for CoreAnimation.

Projects that are alternatives of or similar to Mystique

Tkswitchercollection
An animation switch collection
Stars: ✭ 877 (+1939.53%)
Mutual labels:  carthage, coreanimation
Tkrubberindicator
A rubber animation pagecontrol
Stars: ✭ 1,337 (+3009.3%)
Mutual labels:  carthage, coreanimation
Stepslider
StepSlider its custom implementation of slider such as UISlider for preset integer values.
Stars: ✭ 391 (+809.3%)
Mutual labels:  carthage, coreanimation
Launchatlogin
Add “Launch at Login” functionality to your macOS app in seconds
Stars: ✭ 837 (+1846.51%)
Mutual labels:  carthage
Quiver
Validation, searching and filtering made easy for swift.
Stars: ✭ 27 (-37.21%)
Mutual labels:  carthage
Sica
🦌 Simple Interface Core Animation. Run type-safe animation sequencially or parallelly
Stars: ✭ 980 (+2179.07%)
Mutual labels:  carthage
Wstagsfield
An iOS text field that represents tags, hashtags, tokens in general.
Stars: ✭ 1,013 (+2255.81%)
Mutual labels:  carthage
Imagescout
A Swift implementation of fastimage. Supports PNG, GIF, and JPEG.
Stars: ✭ 940 (+2086.05%)
Mutual labels:  carthage
Fontblaster
Programmatically load custom fonts into your iOS and tvOS app.
Stars: ✭ 1,000 (+2225.58%)
Mutual labels:  carthage
Queuer
Queuer is a queue manager, built on top of OperationQueue and Dispatch (aka GCD).
Stars: ✭ 964 (+2141.86%)
Mutual labels:  carthage
Bfkit Swift
BFKit-Swift is a collection of useful classes, structs and extensions to develop Apps faster.
Stars: ✭ 963 (+2139.53%)
Mutual labels:  carthage
Ctpanoramaview
A library that displays spherical or cylindrical panoramas with touch or motion based controls.
Stars: ✭ 951 (+2111.63%)
Mutual labels:  carthage
Swiftysound
SwiftySound is a simple library that lets you play sounds with a single line of code.
Stars: ✭ 995 (+2213.95%)
Mutual labels:  carthage
Gaugekit
Kit for building custom gauges + easy reproducible Apple's style ring gauges.
Stars: ✭ 997 (+2218.6%)
Mutual labels:  carthage
Swiftlyext
SwiftlyExt is a collection of useful extensions for Swift 3 standard classes and types 🚀
Stars: ✭ 31 (-27.91%)
Mutual labels:  carthage
Sketchkit
A lightweight auto-layout DSL library for iOS & tvOS.
Stars: ✭ 40 (-6.98%)
Mutual labels:  carthage
Tbactionsheet
A Custom&Powerful Action Sheet For iOS. 一个 ActionSheet 满足所有样式!超高自由度的可定制!
Stars: ✭ 942 (+2090.7%)
Mutual labels:  carthage
Vktableview
Hi! I was working on an app where I had to show information about 10-12 different entities and each entity details are to be shown in a UICollectionView. Thought of adding some fancy element and I came up with this project. Would love your feedback. Please have a look at GIF attached to have a better idea of what I have come up with. Swift4.
Stars: ✭ 30 (-30.23%)
Mutual labels:  coreanimation
Centeredcollectionview
A lightweight UICollectionViewLayout that 'pages' and centers its cells 🎡 written in Swift
Stars: ✭ 965 (+2144.19%)
Mutual labels:  carthage
Imagecoordinatespace
UICoordinateSpace for UIImageView image
Stars: ✭ 42 (-2.33%)
Mutual labels:  carthage

Mystique

Version License Platform Carthage compatible Xcode 8.2+ iOS 8.0+

Introduction

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

Demo

demo

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

// Animate the radiations
[radiation mt_startAnimations:^(MTAnimator *animate) {
    animate.opacity
        .from(@1.0)
        .to(@0.0)
        .animate(duration);
    animate.scale
        .from(@1.0)
        .to(@0.0)
        .animate(duration);
    animate.center
        .mt_from(fromPoint)
        .mt_to(toPoint)
        .animate(duration);
} completion:^{
    [radiation removeFromSuperlayer];
}];

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

Check out the Mystique iOS Examples to get more details.

Installation

Cocoapods

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

pod "Mystique"

Carthage

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.x.to(@100.0).animate(1.0);

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

Attributes

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.

animate.width.to(@100).animate(1.0)

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

animate.x.to(@50).after(1.0).to(@200).animate(2.0)

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

// it will disappear in one second and appear again after two second delay
animate.opacity
    .to(@0.0).after(1.0)
    .delay(2.0).to(@1.0).animate(1.0)

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.

animate.scale
    .byValues(@[ @0.0, @1.1, @1.0 ])
    .during(@[ @0.0, @0.5, @1.0 ])
    .animate(duration);

/* 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;
*/

Debug

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

animate.logEnable = YES

Credit

Thanks their incredible works!

JHChainableAnimations

Masonry

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].