转载

[iOS] Stellar:通过物理引擎 UIDynamic 实现超酷物理动画类库

[iOS] Stellar:通过物理引擎 UIDynamic 实现超酷物理动画类库

A fantastic Physical animation library for swift(Not Just Spring !!!), it is base on UIDynamic and extension to it, friendly APIs make you use it or custom your own animation very easily!

Support

Features

  • View's Animation
  • Layer's Animation
  • Chainable
  • File configurable (come soon)

Animations

  • Basic
  • Gravity
  • Snap
  • Attachment
  • Push
  • Collsion(come soon)

Animatable type

  • Float
  • CGFloat
  • Double
  • CGSize
  • CGPoint
  • CGRect
  • UIColor
  • ......(Any Intrpolatable)

On display

Funny demo's gif(s)

[iOS] Stellar:通过物理引擎 UIDynamic 实现超酷物理动画类库 [iOS] Stellar:通过物理引擎 UIDynamic 实现超酷物理动画类库

Chainable

[iOS] Stellar:通过物理引擎 UIDynamic 实现超酷物理动画类库

ball.moveX(100).moveY(100).duration(1)     .then().makeWidth(160).duration(2).anchorPoint(CGPointMake(0, 0.5))     .then().rotate(1.5).snap(0.5)     .then().moveY(500).duration(0.5)     .animate()  

[iOS] Stellar:通过物理引擎 UIDynamic 实现超酷物理动画类库

for (index,line) in leftLines.enumerate() {     let delay = Double(index) * 0.2      line.moveX(200).duration(2).easing(.SwiftOut).delay(delay)         .then().moveX(-200).rotateY(1.43).easing(.SwiftOut)         .makeColor(UIColor.greenColor()).repeatCount(100)         .autoreverses().duration(2).animate()  }   for (index,line) in rightLines.enumerate() {     let delay = Double(index) * 0.2      line.moveX(-200).duration(2).easing(.SwiftOut).delay(delay)         .then().moveX(200).rotateY(1.43).easing(.SwiftOut)         .makeColor(UIColor.purpleColor()).repeatCount(100)         .autoreverses().duration(2).animate()  }  

Snap Curve

[iOS] Stellar:通过物理引擎 UIDynamic 实现超酷物理动画类库

Attachment Curve

[iOS] Stellar:通过物理引擎 UIDynamic 实现超酷物理动画类库

Gravity Curve

[iOS] Stellar:通过物理引擎 UIDynamic 实现超酷物理动画类库

Push Curve

[iOS] Stellar:通过物理引擎 UIDynamic 实现超酷物理动画类库

Basic Curve

[iOS] Stellar:通过物理引擎 UIDynamic 实现超酷物理动画类库

To do

  • File configurable
  • More demos

Licence

Copyright (c) 2016

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

原文  https://github.com/AugustRush/Stellar
正文到此结束
Loading...