Swift写的易用、高可读链式动画类库。
示例一:
// Create view let box = UIView(frame:CGRectMake(100,100,50,50)) view.backgroundColor = UIColor.blueColor() view.addSubview(box) // Move to 100px right box.cheetah.move(100, 0).run()
示例二:
view.cheetah .move(100, 0) .rotate(M_PI * 2) .scale(1.5) .run()
示例三:
view.cheetah .move(100, 0).rotate(M_PI) .wait() .move(-100, 0).rotate(-M_PI) .wait(1.0) // <- wait 1 sec to start next animation .move(0, -20).duration(0.4) .wait() .move(0, 20).duration(0.4) .run()
示例四:
view.cheetah .move(100, 0).duration(1.0).delay(1.0) .rotate(M_PI).duration(2.0) .wait(1) .move(-100, 0).duration(0.4) .run()
示例五:
//要重复动画,使用repeatCount(count: Int) view.cheetah.rotate(M_PI_2).run().repeat(3) //永远重复,使用forever view.cheetah.rotate(M_PI_2).run().forever
示例六:
示例七: