Giter VIP home page Giter VIP logo

walker's Introduction

Walker

Carthage Version License Platform Documentation Swift

The story

Seeing the animations behind Paper, or the transitions behind Mail, being in a world of flat design and transitions, user interaction, app behavior and responsiveness are key, we need good and fast animations to delight our users in every tap, every scroll, every moment that they spend in our app.

After lots of apps, designs and animations, after trying some of the most famous web frameworks and after I learnt FramerJS, which has one of the most beautiful springs I've seen. I'm building a collection of my knowledge, as I said when I was learning iOS development I would do, let me present Walker to you, an animation engine and library.

Walker has a bohemian companion that wanders with him, Morgan, a set of animations that will make your life easier when developing iOS apps. Note that Morgan is unfinished and always improving.

Code

Walker has different types of use cases and behaviors, you can either have a chain of animations with different blocks and callbacks, or reuse animations and apply them in different cases.

animate(view) {
  $0.alpha = 1
}.then {
  print("First animation done")
}.chain {
  $0.width = 300
}.finally {
  print("Animations done")
}

Inside every animation there are different curves, the basic ones, which are Linear, Ease, EaseIn, EaseOut and EaseInOut, a custom Cubic Bezier and a Spring animation.

Cubic Bezier

Considering Linear, Ease, EaseIn, EaseOut and EaseInOut cubic animations, the following animation will just have the Bezier one, even though everything is called the same way.

animate(view, curve: .Bezier(1, 0.4, 1, 0.4)) {
  $0.x = 100
}

Bezier

Springs

Springs are the most beautiful animations in the spectrum, taking inspiration of the curve used in FramerJS, you'll have a look alike feel that you are going to be able to configure like the following set.

spring(view, spring: 200, friction: 10, mass: 10) {
  $0.x = 40
}

Spring

Chains

As stated in the first example, you can chain animations, but not only animations with the same curve, every block has an independent status, so you'll be able to chain springs and bezier animations, being notified when everything finishes if you want.

spring(view, spring: 200, friction: 10, mass: 10) {
  $0.x = 100
}.chain {
  $0.x = 0
}

Chain

Create your own

It wouldn't be a good animation engine if you couldn't reuse animations, there's a component inside the engine called Still, this one will talk to the background motor and will provide you with a CAKeyframeAnimation, just by calling this:

let animation = Still.bezier(.PositionX, curve: .Bezier(1, 0.4, 1, 0.4))

Still can have, as the engine above, Cubic Bezier and Spring animations inside, each one configured differently. Note also that this will provide a layer animation.

Finally, this animation won't be tight to a final value or to any view, so you can reuse it across by distilling it:

distill((animation: animation, final: 100), view: view)

Distill works with as many animations at a time as you want.

Bezier

More questions?

Have more questions and want to see more implementation in detail? We have a demo for you. Inside it you'll find some different animations applied into different views, you can check the file right here. If you still have something unclear, don't hesitate to contact me or open an issue.

Installation

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

pod 'Walker'

Walker is also available through Carthage. To install just write into your Cartfile:

github 'RamonGilabert/Walker'

Upcoming features

Check out the ROADMAP file to see the upcoming features that we are thinking to implement and don't hesitate to open an issue or make a PR with a proposal in the roadmap.

Author

Ramon Gilabert with ♥️

Contribute

We would love you to contribute to Walker, check the CONTRIBUTING file for more info.

License

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

walker's People

Contributors

ramongilabert avatar

Stargazers

lee avatar Cristian A Monterroza avatar PayHere Developers avatar Oops avatar  avatar  avatar  avatar MohsinAli avatar  avatar Rastislav Mirek avatar ShadowParticle avatar Jonathan avatar  avatar Gleb Karpushkin avatar Rafael Passos avatar Roman avatar Yuske Fukuyama avatar Samet Macit avatar  avatar Iain Reid avatar Pranav Raj Singh Chauhan avatar Mladen Djordjevic avatar  avatar Rathish Marthandan avatar  avatar Marius Kažemėkaitis avatar Matej Ľach avatar Kyle Howells avatar Wellington Moreno avatar Pulkit Sood avatar Hashem avatar Hayden Holligan avatar ms avatar Mohamad Kaakati avatar Helbert Gomes avatar Rita Zerrizuela avatar Renaud Bouissière avatar Jason Phillips avatar  avatar Arnaud Joubay avatar Alejandro Ravasio avatar  avatar John D. Pope avatar Guilherme Verri avatar Kai Li avatar Keblo avatar Massimiliano Del Maestro avatar  avatar Mathias Quintero avatar Philip Kluz avatar Daniel Hanover avatar Daniel Tarazona avatar  avatar Jianbin LIN avatar Alessandro Aresta avatar Keith Lee avatar Nate Turner avatar zhong zhang avatar  avatar Bernard Gatt avatar  avatar Alan O'Connor avatar Robert Herdzik avatar Jais Cheema avatar  avatar Leo Tumwattana avatar HaviLee avatar David Lee avatar Benno L avatar  avatar Gurpartap Singh avatar Kristian Andersen avatar Willi Wu avatar Moath othman avatar  avatar Karim Sallam avatar Liguo Jiao avatar Fabio Giolito avatar lchence avatar Philip Vasilchenko avatar Emmanuel Masangcay avatar Akshay Rangnekar avatar Eirik Eikås avatar Mathias avatar Vodca avatar  avatar Hardik Shah avatar Michael Mellinger avatar Johannes Gorset avatar Simon Strandgaard avatar Elie Mouawad avatar  avatar  avatar Leo avatar Carabineiro avatar Matthew Davis avatar Rob Warner avatar Zhanserik avatar André J avatar Ralph Li avatar

Watchers

Jacob Relkin avatar Fabio Giolito avatar James Cloos avatar MohsinAli avatar  avatar Carabineiro avatar He, Yong(LEON) avatar  avatar  avatar Helbert Gomes avatar

walker's Issues

Swift 2.3 compatibility

Hi !

Can you please consider adding a swift 2.3 compatibility branch ?

BTW, thanks for your work 👍

CADisplayLink?

Hey,

First of all Awesome concept!

Couple of questions:

  1. Does your Library use CADisplayLink or?
  2. 60fps?
  3. Support for interactions while animation is happening?
  4. Could you talk a little about what drives the animation?

Thanks.

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.