• Stars
    star
    801
  • Rank 56,886 (Top 2 %)
  • Language
    Objective-C
  • License
    Apache License 2.0
  • Created over 10 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A collection of animations for iOS. Simple, just add water animations.

DCAnimationKit

A collection of animations for iOS Simply, just add water! DCAnimationKit is a category on UIView to make animations easy to perform.

Examples

All our examples will use this as a base.

self.moveLabel = [[UILabel alloc] initWithFrame:CGRectMake(80, 85, 200, 100)];
self.moveLabel.backgroundColor = [UIColor clearColor];
self.moveLabel.text = NSLocalizedString(@"Animate!", nil);
self.moveLabel.font = [UIFont systemFontOfSize:36];
[self.moveLabel sizeToFit];
[self.view addSubview:self.moveLabel];

self.moveView = [[UIView alloc] initWithFrame:CGRectMake(40, 165, 200, 100)];
self.moveView.backgroundColor = [UIColor orangeColor];
[self.view addSubview:self.moveView];

Attention getters

Tada

alt tag

our method to run tada.

[self.moveView tada:NULL];
[self.moveLabel tada:NULL];

Bounce

alt tag

our method to run bounce.

[self.moveView bounce:NULL];
[self.moveLabel bounce:NULL];

Pulse

alt tag

our method to run pulse.

[self.moveView pulse:NULL];
[self.moveLabel pulse:NULL];

Shake

alt tag

our method to run shake.

[self.moveView shake:NULL];
[self.moveLabel shake:NULL];

Swing

alt tag

our method to run swing.

[self.moveView swing:NULL];
[self.moveLabel swing:NULL];

Intros

Intros have a slight difference from the base code. We simple remove these 2 lines:

//[self.view addSubview:self.moveLabel];
//[self.view addSubview:self.moveView];

This lines will be added to the view once they snap in.

Snap

alt tag

our method to run the snap in.

[self.moveLabel snapIntoView:self.view direction:DCAnimationDirectionTop];
[self.moveView snapIntoView:self.view direction:DCAnimationDirectionLeft];

Bounce

alt tag

our method to run the bounce in.

[self.moveLabel bounceIntoView:self.view direction:DCAnimationDirectionTop];
[self.moveView bounceIntoView:self.view direction:DCAnimationDirectionLeft];

Expand

alt tag

our method to run the expand.

[self.moveLabel expandIntoView:self.view finished:NULL];
[self.moveView expandIntoView:self.view finished:NULL];

Outros

Compress

alt tag

our method to run the compress.

[self.moveLabel expandIntoView:NULL];
[self.moveView expandIntoView:NULL];

Hinge

alt tag

our method to run the hinge.

[self.moveLabel hinge:NULL];
[self.moveView hinge:NULL];

Drop

alt tag

our method to run the drop.

[self.moveLabel drop:NULL];
[self.moveView drop:NULL];

General transitions

To round off our fantastic animations, DCAnimationKit also simplifies doing ordinary frame manipulation.

UIView *baseView = [[UIView alloc] initWithFrame:CGRectMake(40, 85, 50, 50)];
baseView.backgroundColor = [UIColor grayColor];
[self.view addSubview:baseView];

self.moveView = [[UIView alloc] initWithFrame:baseView.frame];
self.moveView.backgroundColor = [UIColor redColor];
[self.view addSubview:self.moveView];

Move

alt tag

our code to move around.

CGFloat distance = 80;
__weak id weakSelf = self.moveView;
[weakSelf moveX:distance finished:^{
    [weakSelf moveY:distance finished:^{
        [weakSelf moveX:-distance finished:^{
            [weakSelf moveY:-distance finished:^{

            }];
        }];
    }];
}];

We can also set the view's origin to a specific value as well.

__weak id weakSelf = self.moveView;
[weakSelf setX:200 finished:^{
    [weakSelf setY:200 finished:^{
        [weakSelf setX:40 finished:^{
            [weakSelf setY:85 finished:^{

            }];
        }];
    }];
}];

We can even slide to a specific point (there is a move as well!).

[self.moveView movePoint:CGPointMake(100, 100) finished:NULL];

Rotation

alt tag

our code to rotate (there is a move rotation as well).

__weak id weakSelf = self.moveView;
[weakSelf setRotation:45 duration:.35 finished:^{
    [weakSelf setRotation:0 duration:.35 finished:^{

    }];
}];

Install

The recommended approach for installing DCAnimationKit 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 DCAnimationKit:

$ cd /path/to/MyProject
$ touch Podfile
$ edit Podfile
platform :ios, '7.0'
pod 'DCAnimationKit'

Install into your project:

$ pod install

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

Requirements

DCAnimationKit requires at least iOS 7 or above.

License

DCAnimationKit is license under the Apache License.

Contact

Dalton Cherry

More Repositories

1

Starscream

Websockets in swift for iOS and OSX
Swift
8,302
star
2

SwiftHTTP

Thin wrapper around NSURLSession in swift. Simplifies HTTP requests.
Swift
1,880
star
3

JSONJoy-Swift

Convert JSON to Swift objects.
Swift
354
star
4

Skeets

Fetch, cache, and display images via HTTP in Swift.
Swift
191
star
5

bumblebee

Abstract text processing and pattern matching engine in Swift. Converts text into NSAttributedStrings. Builtin markdown support.
Swift
109
star
6

tarkit

untar and tar files on iOS and OS X. Also supports gzip tars.
Objective-C
89
star
7

SwiftLog

Simple and easy logging in Swift.
Swift
72
star
8

UICustomizeKit

Base UIKit components extended to allow almost any customizations. Comes with Bootstrap and Flat UIs out of the box.
Objective-C
68
star
9

JSONJoy

Makes JSON a joy to use
Objective-C
56
star
10

FontAwesome-iOS

Provides easy access to font Awesome icons in iOS
Objective-C
46
star
11

DCLabel

Convert markdown or html text with embed content into a label.
Objective-C
31
star
12

DCCommentView

Comment view for iOS, same as messages app. Customizable.
Objective-C
30
star
13

Jazz

Easier layer animations in Swift
Swift
25
star
14

DCTextEngine

An engine that convert text to attributed strings and attributed strings to text. Supports HTML and markdown by default.
Objective-C
23
star
15

DCSideNav

Custom Navigation for iPad. Similar to iPad twitter app navigation.
Objective-C
17
star
16

DCDataViews

Simple and Powerful data management model for UITableView and UICollectionView to make simpler and faster to use.
Objective-C
10
star
17

GPLib-iOS

General Purpose iOS library
Objective-C
10
star
18

FeedView

A simple feed based view in Swift with customizable and delightful animations. Think UICollectionView with the animations you always wanted.
Swift
9
star
19

DCAvatar

A simple, asynchronous, network based avatar library for iOS and OSX
Objective-C
7
star
20

DCSlideOutViewController

Does the slide view thing as seen in Path app.
Objective-C
7
star
21

SimpleSwiftApp

Just a basic Swift App using SwiftHTTP and JSONJoy
Swift
6
star
22

DCXMPP

XMPP library for iOS or OSX in objective-c
Objective-C
5
star
23

XMLKit-objc

XML parsing in objective-C
Objective-C
2
star
24

Sideswipe

Network Image Library in Swift
Swift
2
star
25

common-crypto-spm

common crypto headers provided for the Swift Package Manager
Swift
2
star
26

bazaarvoice-challenge

Bazaarvoice programming exercise
Swift
1
star
27

goguid

generate GUID and UUIDs in go.
Go
1
star
28

daltoniam.com

portfolio website
CSS
1
star
29

bro

learn to write in a interpreter in C
C
1
star