Skip to content

A simple and easy-to-use wrapper class to deal with iOS animations.

License

Notifications You must be signed in to change notification settings

SoufianHossam/AnimationBuilder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AnimationBuilder

A simple and easy-to-use wrapper class to deal with iOS animations.

Overview

How to use

Instanciate an object from AnimationBuilder, and provide it with the view you want to animate, then use the dot operator to access all it's properties. To run the animation just use .execute

AnimationBuilder(for: passwordTF)
            .translateX(view.frame.width)
            .damping(0.6)
            .duration(1.2)
            .execute(type: .transitional)

You have two options to execute the animation:

  • .transitional : Shifts the view to the desired location then animate it back to it's original location.
  • .permanent : Animate the view to new location permanently.

To run some code after the animation, use the completion block:

AnimationBuilder(for: cardView)
            .alpha(1, 0)
            .translateX(view.frame.width)
            .damping(0.8)
            .initialVeclocity(1)
            .options(.curveEaseOut)
            .duration(0.2)
            .execute(type: .permanent, completion: {
                self.dismiss(animated: true)
            })

Installation

Just include AnimationBuilder.swift in your project.

Demo

Check out the Example project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

A simple and easy-to-use wrapper class to deal with iOS animations.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages