Simple and powerful animation library built in Objective-C, compatible with Swift.
- Numerous animatable properties
- Multi-stage animations
- Callbacks
- Simplified Effects Wrapper
SLAnimation is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'SLAnimation'
Common effects at your finger tips.
- 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)
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)];
Shake
Pop (In/Out)
Rise (In/Out) -> No spring motion
Fall (In/Out) -> No spring motion
Slide Left (In/Out)
Bounce Left (In/Out) -> i.e. Slide with a slight spring motion
Unroll Down (In/Out)
**Fade Down (In/Out) -> Small vertical displacement, with fade **
**Fade Up (In/Out) -> Small vertical displacement, with fade **
Core class for advanced usage
- View
- Time
- Alpha
- Center
- Color: Background
- Frame
- Shadow Opacity
- Transform X, Transform Y, Transform XY
- Delay
- Callback (+ Callback Object)
SLAnim *anim = [[SLAnim alloc] init];
// (Set Compulsary)
// (Set Animation Properties)
// (Set Optionals)
[anim animate];
- 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];
- 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];
Jack Wong
SLAnimation is available under the MIT license. See the LICENSE file for more info.