Stellar 0.61

Stellar 0.61

测试已测试
语言语言 SwiftSwift
许可 自定义
发布最后发布2016 年 6 月
SPM支持 SPM

August rush 维护。



Stellar 0.61

  • AugustRush

codebeat badge

一个出色的物理动画库 Swift,不仅仅只是弹簧!,它基于 UIDynamic 的扩展,友好的 API 使您能够非常容易地使用或自定义自己的动画!

支持

集成

手动(iOS 8+)

要手动将此库用于您的项目,您可以这样操作

  • 对于项目,只需将 Stellar 资源 拖到项目树中
  • 对于工作区,包含整个 StellarDemo.xcodeproj

功能

- View's Animation
- Layer's Animation
- Chainable (every step can be observed)
- File configurable (come soon)

动画

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

可动画类型

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

缓动曲线

- Default
- EaseIn
- EaseOut
- EaseInEaseOut
- Linear
- SwiftOut
- BackEaseIn
- BackEaseOut
- BackEaseInOut
- BounceOut
- Sine
- Circ
- ExponentialIn
- ExponentialOut
- ElasticIn
- ElasticOut
- BounceReverse
- Custom(Double, Double, Double, Double)

显示时

有趣演示gif

链式调用

1) 通用

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()
 }

2) 每步完成可观察

animateView.makeSize(CGSizeMake(50, 150)).snap(0.3).completion({
                print("First step")
            })
            .then().moveX(-100).moveY(-50).anchorPoint(CGPointMake(1, 1)).duration(1).completion({
                print("Second step!")
            })
            .then().rotate(CGFloat(M_PI)).attachment(0.3, frequency: 0.8).completion({
                print("Third step!")
            })
            .then().moveY(500).completion({
                print("last step, all completion")
            })
            .animate()


回复曲线

附加曲线

重力曲线

推力曲线

基本曲线

待办事项

- File configurable
- Easily Interactive Animations
- Collision
- Mutilple View/Layer performance
- More demos

许可

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.