explaingit

marcosgriselli/viewanimator

7,329SwiftAudience · developerComplexity · 2/5Setup · easy

TLDR

A Swift library for iOS and iPad apps that adds slide, zoom, and rotation animations to any UI element with a single line of code, including built-in spring bounce effects.

Mindmap

mindmap
  root((repo))
    What it does
      UI animations
      Single line code
      iOS library
    Animation Types
      Direction based
      Zoom animations
      Rotation animations
    Supported Views
      Table views
      Collection views
      Stack views
    Setup
      CocoaPods
      Carthage
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Add slide-in animations to a table view when it loads so rows appear one by one from the bottom instead of all at once

USE CASE 2

Combine a zoom and directional animation on collection view cells to create a polished product grid reveal on an onboarding screen

USE CASE 3

Animate an entire stack of UI elements into place at once using a single function call with a natural spring bounce

Tech stack

SwiftiOSCocoaPodsCarthage

Getting it running

Difficulty · easy Time to first run · 30min

Requires iOS 8 or later and Swift 4.0 minimum, install via CocoaPods or Carthage.

In plain English

ViewAnimator is a Swift library for iPhone and iPad app developers that makes it easy to add motion effects to parts of the user interface. With a single line of code, views on the screen can slide in from a direction, zoom in or out, or rotate into place, instead of appearing all at once. The library works with standard iOS components: standalone views, tables (where content appears in scrollable rows), grid-like collection views (where items appear in a tiled layout), and stack views (where items are arranged in a line). Each of these can have their visible items animated individually or all at once, in one call. Three animation types are built in. Direction-based animations make a view appear to fly in from any edge of the screen by a specified distance. Zoom animations scale a view up or down from a smaller or larger starting size. Rotation animations tilt a view around its center before it settles into position. These types can be combined freely, so a cell in a list could zoom in and slide from the right at the same time. A spring effect is included in the motion by default, giving animations a natural bounce rather than a mechanical stop. Installation follows standard iOS library conventions. It can be added to a project through CocoaPods or Carthage (both are package management tools common in the iOS ecosystem), or the Swift files can be dropped into a project manually. The library requires iOS 8 or later and Swift 4.0.

Copy-paste prompts

Prompt 1
I'm building an iOS app in Swift and want to animate my UITableView cells so they slide in from the bottom when the view appears. Show me how to add ViewAnimator as a CocoaPods dependency and call the animate function on the table view's visible cells.
Prompt 2
I want to combine a zoom-in and a slide-from-right animation on a UICollectionView in my iOS app using ViewAnimator. Show me the Swift code to do both animations together on visible cells.
Prompt 3
I have a UIStackView with several buttons and I want them all to rotate in when the screen loads using ViewAnimator. Write the Swift code to animate all the arranged subviews at once.
Open on GitHub → Explain another repo

← marcosgriselli on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.