Giter VIP home page Giter VIP logo

tableflip's Introduction

TableFlip

(╯°□°)╯︵ ┻━┻


┬──┬ ノ( ゜-゜ノ)


Animations are cool. UITableView isn't. So why not make animating UITableView cool?


The entire API for TableFlip consists of an animation, and a call to animate. It's as simple as that.
TableFlip takes the annoying nature of reloading UITableViews, maintaining state, and anminating, and minimizes it to two lines of code.
If you want to animate every cell consecutively, the code will look like this.
self.tableView.reloadData()
self.tableView.animateCells(animation: myCoolCellAnimation)
And if you want to animate the entire table view at once, the code will look like this:
self.tableView.reloadData()
self.tableView.animateTableView(animation: myCoolTableAnimation)

Animations are completely customizable and configurable. TableFlip provides a few built-in defaults that work nicely out the box, if you don't want to make your own.

Let's look at some examples

Animating from the left with a nice staggered effect:

TableViewAnimation.Cell.left(duration: 0.5)

Pushing from the top can make a nice initial loading effect:

TableViewAnimation.Table.top(duration: 0.8)

A simple fade is always elegant:

TableViewAnimation.Cell.fade(duration: 1.0)

And you can make your own transform, as fun or weird as you want by using CGAffineTransform:

let degrees = CGFloat(sin(90.0 * M_PI/180.0))
let rotationTransform = CGAffineTransform(rotationAngle: degrees)
let flipTransform = CGAffineTransform(scaleX: -1, y: -1)
let customTransform = rotationTransform.concatenating(flipTransform)

self.loadImages(withAnimation: TableViewAnimation.Cell.custom(duration: 0.6, transform: customTransform, options: .curveEaseInOut))

Installation

You can use CocoaPods to install TableFlip by adding it to your Podfile:

platform :ios, '8.0'
use_frameworks!

pod 'TableFlip'

Or install it manually by downloading UITableView+Animations.swift and dropping it in your project.

About me

Hi, I'm Joe everywhere on the web, but especially on Twitter.

License

See the license for more information about how you can use TableFlip.

P.S.

If all you liked was the kitty, that's my baby Gif. Feel free to follow her on the Instagram.

tableflip's People

Contributors

mergesort avatar

Watchers

Carabineiro avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.