Code Monkey home page Code Monkey logo

animation-extensions's Introduction

Build Status CodeFactor License Platform Release saythanks.io

A useful UIView category containing a set of most commonly used animations like rotation, flip, shake and others.

It is designed to be as easy to use and integrate as possible with a goal to speed up everyday development tasks. All the methods are well documented and described.

Furthermore, the category comes along with a small demo project where you can see the animations in action.

Animations

Extension contains helper methods for the following animations:

Rotation

[boxView rotateToAngle:M_PI * 2.0f
              duration:1.0f
             direction:UIViewAnimationRotationDirectionLeft
           repeatCount:HUGE_VALF
           autoreverse:YES];

Rotation

Flip

[boxView flipWithDuration:0.3f
                direction:UIViewAnimationFlipDirectionFromLeft
              repeatCount:2
              autoreverse:NO];

Flip

Vertical Shake

[boxView shakeVertically];

Vertical Shake

Horizontal Shake

[boxView shakeHorizontally];

Horizontal Shake

Pulse

[boxView pulseToSize:1.1f
            duration:0.3f
              repeat:YES];

Pulse

Motion Effects

[boxView applyMotionEffects];

Can't be shown in a gif. Run on the device to see it in action.

Installation

The recommended approach for installing Animation Extensions is via the CocoaPods package manager, as it provides flexible dependency management and dead simple installation.

via CocoaPods

Install CocoaPods if not already available:

$ [sudo] gem install cocoapods
$ pod setup

Change to the directory of your Xcode project, and Create and Edit your Podfile and add Animation Extensions:

$ cd /path/to/MyProject
$ touch Podfile
$ edit Podfile
target "YOUR PROJECT" do
	platform :ios, '11.0'
	pod 'UIView+AnimationExtensions', '~> 2.0.0'
end

Install into your project:

$ pod install

Open your project in Xcode from the .xcworkspace file (not the usual project file)

$ open MyProject.xcworkspace

Please note that if your installation fails, it may be because you are installing with a version of Git lower than CocoaPods is expecting. You can get a full picture of the installation details by executing pod install --verbose.

Using Animation Extensions in a Swift Project

Install Animation Extensions using one of the above methods. Then

  1. If Animation Extensions are built as a dynamic framework, add:

    @import UIView+AnimationExtensions;

  2. If Animation Extensions are built as a static library, add into the bridging header for your Swift project:

    #import <UIView+AnimationExtensions/UIView+AnimationExtensions.h>

Thread Safety

UIView Animation Extensions is a category on UIView and - as with all UIKit components - it should only be accessed from the main thread.

License

This code is distributed under the terms and conditions of the CC0 v1.0 license.

Copyright (c) 2017 Rafał Sroka

Credits

Animation Extensions are brought to you by Rafał Sroka.

animation-extensions's People

Contributors

r3econ 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.