Latest1.4.3
Homepagehttps://github.com/jclwong/SLAnimation
LicenseMIT
Platformsios 8.0
Authors

Simple and powerful animation library built in Objective-C, compatible with Swift.

Features:

  • Numerous animatable properties
  • Multi-stage animations
  • Callbacks
  • Simplified Effects Wrapper

Installation

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

pod 'SLAnimation'

Class: SLAnimUtil

Common effects at your finger tips.

Effects:

  • Shake
  • Pop (in/out)
  • Rise (in/out)
  • Fall (in/out)
  • Slide Left (in/out)
  • Slide Right (in/out)
  • Bounce Left (in/out)
  • Bounce Right (in/out)
  • Unroll Down (in/out)
  • Fade Down (in/out)
  • Fade Up (in/out)

Usage:

Effect: Simple

[SLAnimUtil animEffect:SLA_EFFECT_SHAKE view:view time:0.5];

Effect: With Delay

[SLAnimUtil animEffect:SLA_EFFECT_SHAKE view:view time:0.5 delay:0.5];

Effect: With Delay + Callback

[SLAnimUtil animEffect:SLA_EFFECT_SHAKE view:view time:0.5 delay:0.5 cbTarget:self cbSelector:@selector(onAnimateComplete)];

Example:

Shake

Gif

Pop (In/Out)

Gif

Rise (In/Out) -> No spring motion

Gif

Fall (In/Out) -> No spring motion

Gif

Slide Left (In/Out)

Gif

Bounce Left (In/Out) -> i.e. Slide with a slight spring motion

Gif

Unroll Down (In/Out)

Gif

Fade Down (In/Out) -> Small vertical displacement, with fade

Fade Up (In/Out) -> Small vertical displacement, with fade

Class: SLAnim

Core class for advanced usage

Compulsary

  • View
  • Time

Animatable Properties:

  • Alpha
  • Center
  • Color: Background
  • Frame
  • Shadow Opacity
  • Transform X, Transform Y, Transform XY

Optional

  • Delay
  • Callback (+ Callback Object)

Usage:

SLAnim *anim = [[SLAnim alloc] init];
// (Set Compulsary)
// (Set Animation Properties)
// (Set Optionals)
[anim animate];

Use-case: Pop In Effect

  • Scale up (slightly larger)
  • Scale down (correct size)
    SLAnim *anim = [[SLAnim alloc] initWithView:view];
    [anim setTimes:@[@(0.4), @(0.1)]];
    [anim setProp:SLA_PROP_TRANSFORM_XY values:@[@0, @1.1, @1]];
    [anim animate];

Use-case[2]: Pulse Alpha

  • Fade In
  • Fade Out Slow
  • Optional: Trigger callbacks
    SLAnim *anim = [[SLAnim alloc] initWithView:view];
    [anim setTimes:@[@(0.1), @(0.4)]];
    [anim setProp:SLA_PROP_ALPHA values:@[@0, @1, @0]];
    [anim setCallbackTarget:self callbackSelector:@selector(onAnimateComplete)];
    [anim animate];

Author

Jack Wong

License

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

Latest podspec

{
    "name": "SLAnimation",
    "version": "1.4.3",
    "license": {
        "type": "MIT"
    },
    "homepage": "https://github.com/jclwong/SLAnimation",
    "authors": {
        "jclwong": "[email protected]"
    },
    "summary": "A Simple and Powerful Animation Library. Written in Obj-C and compatible with Swift.",
    "description": "A Simple and Powerful Animation Library. Written in Obj-C and compatible with Swift. Features chainable animations, callbacks, and super simple effects wrapper.nFeatures numerous animatable properties, multi-stage animations, callbacks and simplified effects wrapper.",
    "source": {
        "git": "https://github.com/jclwong/SLAnimation.git",
        "tag": "1.4.3"
    },
    "source_files": "SLAnimation/Classes/*.{h,m}",
    "platforms": {
        "ios": "8.0"
    }
}

Pin It on Pinterest

Share This