在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:View-Animator开源软件地址:https://gitee.com/mirrors/View-Animator开源软件介绍:ViewAnimator is a library for building complex iOS UIView animations in an easy way. It provides one line animations for any view included the ones which contain other views like UITableView and UICollectionView with its cells or UIStackView with its arrangedSubviews. Entire View UITableView UICollectionView
SVG animations inspired by Luke Zhao's project Hero Complex LayoutsUI created by Messaki, make sure to check out his profile. Logo and banner created by @cintia_ve InstallationCocoaPodsViewAnimator is available through CocoaPods. To installit, simply add the following line to your Podfile: pod "ViewAnimator" ManualDrop the swift files inside of ViewAnimator/Classes into your project. Carthagegithub "marcosgriselli/ViewAnimator" Usage
Self animating viewsViews can animate theirselves calling func animate(animations: [Animation], reversed: Bool = false, initialAlpha: CGFloat = 0.0, finalAlpha: CGFloat = 1.0, delay: Double = 0, duration: TimeInterval = ViewAnimatorConfig.duration, usingSpringWithDamping dampingRatio: CGFloat = ViewAnimatorConfig.springDampingRatio, initialSpringVelocity velocity: CGFloat = ViewAnimatorConfig.initialSpringVelocity, completion: (() -> Void)? = nil) Animating multiple viewsViewAnimator follows the UIKit animations API style with a static method static func animate(views: [UIView], animations: [Animation], reversed: Bool = false, initialAlpha: CGFloat = 0.0, finalAlpha: CGFloat = 1.0, delay: Double = 0, animationInterval: TimeInterval = 0.05, duration: TimeInterval = ViewAnimatorConfig.duration, usingSpringWithDamping dampingRatio: CGFloat = ViewAnimatorConfig.springDampingRatio, initialSpringVelocity velocity: CGFloat = ViewAnimatorConfig.initialSpringVelocity, completion: (() -> Void)? = nil) AnimationTypeDirection
let animation = AnimationType.from(direction: .top, offset: 30.0)view.animate(animations: [animation]) ZoomZoom in and Zoom out animation support. let animation = AnimationType.zoom(scale: 0.5)view.animate(animations: [animation]) Combined AnimationsYou can combine conformances of let fromAnimation = AnimationType.from(direction: .right, offset: 30.0)let zoomAnimation = AnimationType.zoom(scale: 0.2)let rotateAnimation = AnimationType.rotate(angle: CGFloat.pi/6)UIView.animate(views: collectionView.visibleCells, animations: [zoomAnimation, rotateAnimation], duration: 0.5)UIView.animate(views: tableView.visibleCells, animations: [fromAnimation, zoomAnimation], delay: 0.5) Animation
public protocol Animation { var initialTransform: CGAffineTransform { get }} UITableView/UICollection extensionsViewAnimator comes with a set of handy extensions to make your animations in They both expose a method let cells = tableView.visibleCells(in: 1)UIView.animate(views: cells, animations: [rotateAnimation, fadeAnimation]) Mentions
Project DetailsRequirements
ContributingFeel free to collaborate with ideas |
请发表评论