• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ShapeAnimation-Swift: iOS矢量动画框架,使用简单,用Swift开发

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

ShapeAnimation-Swift

开源软件地址:

https://gitee.com/rhcad/ShapeAnimation-Swift

开源软件介绍:

ShapeAnimation-Swift

Vector animation framework in Swift based on SwiftGraphics for iOS 8.

With ShapeAnimation you can easily create various animations with a nice Swift based syntax.

Travis

The current development happens on the develop branch. Code is merged back on master branch infrequently.

SVG animation development with SVGKit happens on the SVG branch.

What's included

  • ShapeView class which contains vector shape layers.

    • Helper functions to add image, text, circle, regular polygon, lines and other shapes.
    • Support gradient fill with animation.
    • Enumerate, hit-test or find layers.
  • Animation extension functions of CALayer.

    • opacityAnimation, flashAnimation, backColorAnimation
    • scaleAnimation, tapAnimation, transformAnimation
    • rotate360Degrees, rotationAnimation
    • shakeAnimation, moveAnimation, moveOnPathAnimation
    • slideToRight, slideAnimation, flipHorizontally, flipVertically
    • Layer dragging: constrainCenterToSuperview, bringOnScreen
  • Animation extension functions of CAShapeLayer.

    • strokeStartAnimation, strokeEndAnimation, lineWidthAnimation
    • strokeColorAnimation, fillColorAnimation, dashPhaseAnimation
    • switchPathAnimation
  • Group animation and cascaded animation.

    • animationGroup for the same layer
    • applyAnimations for multiple layers
    • Use the block-based function in apply() to play cascaded animations.
    • Pause, resume or stop animations.
  • Animations with customized properties

Stroke LinesMove on PathRadar Circles

Rotate PolygonsJumping Ball

Animation with SlidersDrag Layers

Usage

Please see the examples in MasterViewController.swift.

let layer1 = self.addLinesLayer(view, points:[(10.0,20.0),(150.0,40.0),(120.0,320.0)])layer1.strokeEndAnimation().apply() {    layer1.shakeAnimation().apply()}let la2 = self.addLinesLayer(view, points:points2, color: UIColor.blueColor())lla2.scaleAnimation(from:1, to:1.1, repeatCount:3).apply(duration:0.3)let la3 = self.addLinesLayer(view, points:points3, color: UIColor.greenColor())la3.flashAnimation(repeatCount:6).apply()let la4 = self.addLinesLayer(view, points:[(10.0,20.0), (150.0,40.0), (120.0,120.0)])let a1 = la4.moveOnPathAnimation(path).setDuration(1.6)let a2 = la4.rotate360Degrees().setRepeatCount(2)animationGroup([a1, a2]).autoreverses().apply()

Help Wanted

All of this code is very much a work in progress. I'm adding and changing functionality as needed.

Your help wanted. Please fork this project and submit pull requests or [issues][issues].[issues]: https://github.com/rhcad/ShapeAnimation-Swift/issues

Contributions are always welcome in the following areas:

  • Header doc comments explaining what the functions do
  • Useful animation template or application examples
  • Fix issues about animation, Swift usage rules or translations

License

ShapeAnimation-Swift is released under a BSD License. See LICENSE file for details.

FAQ

  • Could not build Objective-C module 'ShapeAnimation':
    • Quit Xcode and delete the sub folders in ~/Library/Developer/Xcode/DerivedData/.

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap