All Projects → marcosgriselli → Viewanimator

marcosgriselli / Viewanimator

Licence: mit
ViewAnimator brings your UI to life with just one line

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Viewanimator

Gskstretchyheaderview
A generic stretchy header for UITableView and UICollectionView
Stars: ✭ 1,624 (-75.36%)
Mutual labels:  uikit, uiview, uicollectionview, uitableview
Closures
Swifty closures for UIKit and Foundation
Stars: ✭ 1,720 (-73.91%)
Mutual labels:  uiview, uicollectionview, uitableview
Pagingkit
PagingKit provides customizable menu UI. It has more flexible layout and design than the other libraries.
Stars: ✭ 1,030 (-84.37%)
Mutual labels:  uikit, uicollectionview, uitableview
Livecollections
Automatically perform UITableView and UICollectionView animations between two sets of immutable data. It supports generic data types and is fully thread-safe.
Stars: ✭ 337 (-94.89%)
Mutual labels:  animations, uicollectionview, uitableview
Owl
A declarative type-safe framework for building fast and flexible lists with UITableViews & UICollectionViews
Stars: ✭ 423 (-93.58%)
Mutual labels:  uikit, uicollectionview, uitableview
TinderUISamples
[ING] - TinderのようなUIを様々な実装で実現してみる
Stars: ✭ 30 (-99.54%)
Mutual labels:  uicollectionview, uikit, uiview
Basecomponents
BaseComponents aims to provide easily reusable and understandable components to increase productivity with UIKit and Foundation APIs
Stars: ✭ 92 (-98.6%)
Mutual labels:  uikit, uicollectionview, uitableview
Squaremosaiclayout
An extandable mosaic UICollectionViewLayout with a focus on extremely flexible customizations 🔶
Stars: ✭ 243 (-96.31%)
Mutual labels:  uikit, uicollectionview, uitableview
StackableTableView
A UITableView subclass that enables setting an array of views for both headers and footers utilizing UIStackView
Stars: ✭ 72 (-98.91%)
Mutual labels:  uitableview, uikit, uistackview
ios ui recipe showcase
iOSアプリ開発 - UI実装であると嬉しいレシピブック掲載サンプル
Stars: ✭ 54 (-99.18%)
Mutual labels:  uitableview, uicollectionview, uikit
Wlemptystate
WLEmptyState is an iOS based component that lets you customize the view when the dataset of a UITableView or a UICollectionView is empty. We created a sample project with the WLEmptyState component to show how you can use it.
Stars: ✭ 305 (-95.37%)
Mutual labels:  uikit, uicollectionview, uitableview
Swiftreorder
Easy UITableView drag-and-drop cell reordering
Stars: ✭ 340 (-94.84%)
Mutual labels:  uikit, uitableview
Tysnapshotscroll
一句代码保存截图,将 UIScrollView UITableView UICollectionView UIWebView WKWebView 网页 保存 为 长图 查看。Save the scroll view page as an image,support UIScrollView,UITableView,UICollectionView,UIWebView,WKWebView.(Support iOS13)
Stars: ✭ 709 (-89.24%)
Mutual labels:  uicollectionview, uitableview
Swipecellkit
A swipeable UITableViewCell or UICollectionViewCell with support for:
Stars: ✭ 5,745 (-12.85%)
Mutual labels:  uikit, uitableview
Animatify Ios
Animation, Effects & Transitions for iOS
Stars: ✭ 350 (-94.69%)
Mutual labels:  uikit, animations
Persei
Animated top menu for UITableView / UICollectionView / UIScrollView written in Swift
Stars: ✭ 3,395 (-48.5%)
Mutual labels:  uicollectionview, uitableview
Functionaltabledata
Declarative UITableViewDataSource implementation
Stars: ✭ 347 (-94.74%)
Mutual labels:  uicollectionview, uitableview
Gltablecollectionview
Netflix and App Store like UITableView with UICollectionView, written in pure Swift 4.2
Stars: ✭ 709 (-89.24%)
Mutual labels:  uicollectionview, uitableview
Epoxy Ios
Epoxy is a suite of declarative UI APIs for building UIKit applications in Swift
Stars: ✭ 377 (-94.28%)
Mutual labels:  uikit, uicollectionview
Shadowview
An iOS Library that makes shadows management easy on UIView.
Stars: ✭ 391 (-94.07%)
Mutual labels:  uikit, uiview

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

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].