GitRead 中文社区
首页趋势排行榜原创文章严选周刊
更多资源
新手训练营
精选专题热门话题GitHub 文档资源精选实战指南

ViewAnimator

ViewAnimator brings your UI to life with just one line

  • 语言Swift
  • 默认分支master
  • 大小12.0 MB
  • 更新2024年3月31日
  • Issues12
在 GitHub 打开
avatarmarcosgriselli

项目介绍

marcosgriselli/ViewAnimator 是一个托管在 GitHub 上的开源项目,主要使用 Swift 编写,采用 MIT License 许可证,目前获得 7.3k 个 Star、482 次 Fork。

仓库全名
marcosgriselli/ViewAnimator

README 摘要

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…

完整内容见 GitHub 原始 README 或本页 。

常见问题

ViewAnimator 用什么语言开发?

主要使用 Swift 编写,采用 MIT License 许可证,目前有 7.3k 个 Star。

ViewAnimator 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 ViewAnimator 的源码?

可以直接克隆仓库:git clone https://github.com/marcosgriselli/ViewAnimator.git,默认分支为 master;安装与运行步骤见仓库 README。

ViewAnimator 最近还在维护吗?

仓库最近一次更新为 2024年3月31日,当前有 12 个未关闭 Issue;Star 数为 7.3k,可作为社区活跃度的参考。

本页面展示项目元数据与原始 README,GitRead 中文社区 编辑团队负责选题收录。

相关仓库

jaywcjlove/awesome-mac avatar
awesome-macjaywcjlove
2 小时前
118.1k
10.1k
2.0k

本项目致力于收集高质量的 macOS 软件,并按不同类别系统化整理,以便于搜索和使用。

appappleapplication+17
Swift
98.6 MB
1
详情
swiftlang/swift avatar
swiftswiftlang
1 天前
70.5k
10.9k
9.6k

Swift 编程语言

Swift
1.3 GB
0
详情
vsouza/awesome-ios avatar
awesome-iosvsouza
8月28日
53.9k
7.0k
33

一份精选的优秀 iOS 生态系统列表,包含 Objective-C 和 Swift 项目

apple-swiftarkitawesome+10
Swift
16.8 MB
0
详情
apple/container avatar
containerapple
2 天前
51.1k
1.8k
595

一款在 Mac 上使用轻量级虚拟机创建和运行 Linux 容器的工具。它使用 Swift 编写,并针对 Apple silicon 进行了优化。

Swift
10.4 MB
0
详情
iina/iina avatar
iinaiina
21 小时前
47.1k
3.0k
2.0k

适用于 macOS 的现代视频播放器。

hacktoberfestmacosmpv+3
Swift
246.3 MB
0
详情
exelban/stats avatar
statsexelban
1 天前
43.2k
1.6k
19

菜单栏中的 macOS 系统监视器

batterybluetoothclock+11
Swift
59.8 MB
0
详情
Alamofire/Alamofire avatar
AlamofireAlamofire
1 周前
42.4k
7.5k
31

Swift 中优雅的 HTTP 网络

alamofirecarthagecertificate-pinning+12
Swift
44.7 MB
0
详情
permissionlesstech/bitchat avatar
bitchatpermissionlesstech
1 天前
37.1k
5.9k
175

蓝牙 mesh 聊天,IRC 氛围

bluetoothbluetooth-ledecentralized+7
Swift
126.8 MB
0
详情

关于

animationsiosswiftuiuicollectionviewuikituistackviewuitableviewuiview
  • MIT License
  • 7.3k Stars
  • 482 Forks
  • 107 Watching

简要分析

热度分
8373
价值分
4535
活跃状态
活跃
GitHub

语言占比

Ruby
Swift

Release

  • Restore `from` animation type2021年6月20日
  • Fix CFBundleVersion issue for Carthage2020年11月23日
  • Predefined Timing Functions Support2020年8月31日
  • Swift Package Manager support2019年10月13日
  • Support for Swift 52019年4月6日

贡献者

marcosgrisellimarcosgriselliahmed-yamanyahmed-yamanycpwhiddencpwhiddenvburojevicvburojevicParkGwangBeomParkGwangBeomaravindmaravindmCharlieOxendineCharlieOxendinetruemetaltruemetalfedetrimfedetrimmoosa-mirmoosa-mircodeOfRobincodeOfRobinss18ss18

CocoaPods Carthage Codebeat License

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 Layouts

UI created by Messaki, make sure to check out his profile.

Logo and banner created by @cintia_ve

Installation

CocoaPods

ViewAnimator is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "ViewAnimator"

Manual

Drop the swift files inside of ViewAnimator/Classes into your project.

Carthage

github "marcosgriselli/ViewAnimator"

Usage

ViewAnimator provides a set of UIView extensions to easily add custom animations to your views. From version 2.0.0 there are two ways to use this extension.

Self animating views

Views can animate theirselves calling .animate(animations: [Animation]) that’s the most basic usage. Here’s the full method that contains many default arguments:

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 views

ViewAnimator follows the UIKit animations API style with a static method UIView.animate(views: [UIView], animations: [Animation]). This makes the library really easy to use and extensible to any kind of view. As the previous example, the method contains a lot of default arguments:

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)

AnimationType

Direction

Direction provides the axis where the animation should take place and its movement direction.

let animation = AnimationType.from(direction: .top, offset: 30.0)
view.animate(animations: [animation])
Zoom

Zoom in and Zoom out animation support.

let animation = AnimationType.zoom(scale: 0.5)
view.animate(animations: [animation])

Combined Animations

You can combine conformances of Animation to apply multiple transforms on your animation block.

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

Animation protocol provides you the posibility of expanding the animations supported by ViewAnimator with exception of the animateRandom function.

public protocol Animation {
    var initialTransform: CGAffineTransform { get }
}

UITableView/UICollection extensions

ViewAnimator comes with a set of handy extensions to make your animations in UITableView and UICollectionView a lot simpler. They both have access to cells in a section to animate easily.

They both expose a method visibleCells(in section: Int) that returns an array of UITableViewCell or UICollectionViewCell.

let cells = tableView.visibleCells(in: 1)
UIView.animate(views: cells, animations: [rotateAnimation, fadeAnimation])

Mentions

  • iOS Dev Weekly 323
  • Natasha The Robot’s Newsleter 147
  • Top 10 Swift Articles October
  • 30 Amazing iOS Swift Libraries (v2018)

Project Details

Requirements

  • Swift 4.0
  • Xcode 7.0+
  • iOS 8.0+

Contributing

Feel free to collaborate with ideas 💭, issues ⁉️ and/or pull requests 🔃.

If you use ViewAnimator in your app I’d love to hear about it and feature your animation here!

Contributors

Author

Marcos Griselli | @marcosgriselli

Twitter Follow

Twitter Follow

License

ViewAnimator is available under the MIT license. See the LICENSE file for more info.

评论

登录 后发表评论
暂无评论
GitRead 中文社区
深度解读 · 趋势洞察 · 价值精选

关于

关于我们联系我们编辑准则收录标准赞赏人员

发现

技术趋势新手训练营资源精选实战指南精选专题热门话题GitHub 文档

条款

隐私政策服务条款网站地图
26.9万收录项目
5万中文话题
155精选专题
发现技术价值,连接开源智慧
© 2026 GitRead · GitHub 中文社区 本站与 GitHub, Inc. 无隶属关系;GitHub 是 GitHub, Inc. 的商标。