For Swift version of Simple UIView Chain Animation Block, pelase check out this file: A_ChainAnimation.swift
A-ChainAnimation is separated from Project A-IOSHelper
This project provides two animation methods:
A-Animation
- One-time animationA-ChainAnimation
- Multiple combination animations
// Objective-C
[box A_AnimationEffect:A_AnimationEffectType_press Repeat:2.5 Duration:1.0];
// Swift
box.a_AnimationEffect(.press, repeat: 2.5, duration: 1.0)
// Objective-C
[box.layer A_AnimationSetScaleX:1.5 AnimtionType:A_AnimationType_easeInOutBounce Duraion:1.0];
// Swift
box.layer.a_AnimationSetScaleX(1.5, animtionType: .easeInOutBounce, duraion:1.0)
// Objective-C
[[[[[box syncAnimate]
setPositionX:20 AnimtionType:A_AnimationType_spring Duraion:2.0]
setSize:CGSizeMake(5, 5) AnimtionType:A_AnimationType_bigLongSpring Duraion:3.0].then
setCornerRadius:10 AnimtionType:A_AnimationType_noEffect]
play];
// Swift
box.syncAnimate()
.setPositionX(20, animtionType: .spring, duraion: 2.0)
.setSize(CGSize(width: 5, height: 5), animtionType: .bigLongSpring , duraion: 3.0)
.then
.setCornerRadius(10, animtionType: .noEffect)
.play()