<commit_before>![](etc/EA.png)

#### ver 1.0.2

_The library doesn't use any private APIs - apps using it should be fine for release on the App Store._

<table width="100%">
<tr>
<td width="300">
<a href="#intro">Intro</a><br>
<a href="#layers">Layer Animations</a><br>
<a href="#springs">Spring Layer Animations</a><br>
<a href="#chains">Chain Animations</a><br>
<a href="#stop">Cancel Chain Animations</a><br>
</td>
<td width="300">
<a href="#installation">Installation</a><br>
<a href="#credit">Credit</a><br>
<a href="#license">License</a><br>
<a href="#version">Version History</a>
</td>
</tr>
</table>

<a name="intro"></a>
Intro
========

`UIView.animateWithDuration:animations:` is really easy to use and you're so familiar with its syntax that you often want it to do just a bit more for you automatically. But it doesn't and you need to import *Bloated.framework* by *Beginner Ninja Coder* in order to make a bit more advanced animations than what `animateWithDuration:animations:` allows you to.

**EasyAnimation** extends what UIKit offers in terms of animations and makes your life much easier because you can do much more without learning some perky new syntax.

### Versions

Easy Animation 1.0+ is written in _Swift 2.0_. If you are looking for a Swift 1.2 version check [Easy Animation 0.7](https://github.com/icanzilb/EasyAnimation/releases/tag/0.7.0).

<a name="layers"></a>
Easy Layer Animations
========

**EasyAnimation** allows you to animate your layers straight from `animateWithDuration:animations:`. No more `CABasicAnimation` code for you. Just adjust the properties of your layers from within the `animations` block and **EasyAnimation** will take care of the rest:
<table width="100%">
<th>CoreAnimation (before)</th>
<tr>
<td valign="top">
<pre lang="Swift">
    let anim = CABasicAnimation(keyPath: "position.x")
    anim.fromValue = 100.0
    anim.toValue = 200.0
    anim.duration = 2.0
    view.layer.addAnimation(anim, forKey: nil)
</pre>
</td>
</tr>
</table>
<table width="100%">
<th>EasyAnimation (after)</th>
<tr>
<td valign="top">
<pre lang="Swift">
    UIView.animateWithDuration(2.0, animations: {
        self.view.layer.position.x = 200.0
    })
</pre>
</td>
</tr>
</table>

![](etc/moveX.gif)

(OK, this example actually works fine also without EasyAnimation but I still keep it here for illustrative purpose)

Or if you need to specify delay, animation options and/or animation curve:

<table width="100%">
<th>CoreAnimation (before)</th>
<tr>
<td valign="top">
<pre lang="Swift">
    let anim = CABasicAnimation(keyPath: "position.x")
    anim.fromValue = 100.0
    anim.toValue = 200.0
    anim.duration = 2.0
    anim.fillMode = kCAFillModeBackwards
    anim.beginTime = CACurrentMediaTime() + 2.0
    anim.timingFunction = CAMediaTimingFunction(name: 
        kCAMediaTimingFunctionEaseOut)
    anim.repeatCount = Float.infinity
    anim.autoreverses = true
    view.layer.addAnimation(anim, forKey: nil)
</pre>
</td>
</tr>
</table>
<table width="100%">
<th>EasyAnimation (after)</th>
<tr>
<td valign="top">
<pre lang="Swift">
    UIView.animateWithDuration(2.0, delay: 2.0, 
        options: .Repeat | .Autoreverse | .CurveEaseOut, 
        animations: {
        self.view.layer.position.x += 200.0

        // let's add more animations 
        // to make it more interesting!
        self.view.layer.cornerRadius = 20.0
        self.view.layer.borderWidth = 5.0
    }, completion: nil)
</pre>
</td>
</tr><commit_msg>Minor README update to Swift 2.0<commit_after>![](etc/EA.png)

#### ver 1.0.2

_The library doesn't use any private APIs - apps using it should be fine for release on the App Store._

<table width="100%">
<tr>
<td width="300">
<a href="#intro">Intro</a><br>
<a href="#layers">Layer Animations</a><br>
<a href="#springs">Spring Layer Animations</a><br>
<a href="#chains">Chain Animations</a><br>
<a href="#stop">Cancel Chain Animations</a><br>
</td>
<td width="300">
<a href="#installation">Installation</a><br>
<a href="#credit">Credit</a><br>
<a href="#license">License</a><br>
<a href="#version">Version History</a>
</td>
</tr>
</table>

<a name="intro"></a>
Intro
========

`UIView.animateWithDuration:animations:` is really easy to use and you're so familiar with its syntax that you often want it to do just a bit more for you automatically. But it doesn't and you need to import *Bloated.framework* by *Beginner Ninja Coder* in order to make a bit more advanced animations than what `animateWithDuration:animations:` allows you to.

**EasyAnimation** extends what UIKit offers in terms of animations and makes your life much easier because you can do much more without learning some perky new syntax.

### Versions

Easy Animation 1.0+ is written in _Swift 2.0_. If you are looking for a Swift 1.2 version check [Easy Animation 0.7](https://github.com/icanzilb/EasyAnimation/releases/tag/0.7.0).

<a name="layers"></a>
Easy Layer Animations
========

**EasyAnimation** allows you to animate your layers straight from `animateWithDuration:animations:`. No more `CABasicAnimation` code for you. Just adjust the properties of your layers from within the `animations` block and **EasyAnimation** will take care of the rest:
<table width="100%">
<th>CoreAnimation (before)</th>
<tr>
<td valign="top">
<pre lang="Swift">
    let anim = CABasicAnimation(keyPath: "position.x")
    anim.fromValue = 100.0
    anim.toValue = 200.0
    anim.duration = 2.0
    view.layer.addAnimation(anim, forKey: nil)
</pre>
</td>
</tr>
</table>
<table width="100%">
<th>EasyAnimation (after)</th>
<tr>
<td valign="top">
<pre lang="Swift">
    UIView.animateWithDuration(2.0, animations: {
        self.view.layer.position.x = 200.0
    })
</pre>
</td>
</tr>
</table>

![](etc/moveX.gif)

(OK, this example actually works fine also without EasyAnimation but I still keep it here for illustrative purpose)

Or if you need to specify delay, animation options and/or animation curve:

<table width="100%">
<th>CoreAnimation (before)</th>
<tr>
<td valign="top">
<pre lang="Swift">
    let anim = CABasicAnimation(keyPath: "position.x")
    anim.fromValue = 100.0
    anim.toValue = 200.0
    anim.duration = 2.0
    anim.fillMode = kCAFillModeBackwards
    anim.beginTime = CACurrentMediaTime() + 2.0
    anim.timingFunction = CAMediaTimingFunction(name: 
        kCAMediaTimingFunctionEaseOut)
    anim.repeatCount = Float.infinity
    anim.autoreverses = true
    view.layer.addAnimation(anim, forKey: nil)
</pre>
</td>
</tr>
</table>
<table width="100%">
<th>EasyAnimation (after)</th>
<tr>
<td valign="top">
<pre lang="Swift">
    UIView.animateWithDuration(2.0, delay: 2.0, 
        options: [.Repeat, .Autoreverse, .CurveEaseOut], 
        animations: {
        self.view.layer.position.x += 200.0

        // let's add more animations 
        // to make it more interesting!
        self.view.layer.cornerRadius = 20.0
        self.view.layer.borderWidth = 5.0
    }, completion: nil)
</pre>
</td>
</tr>
{'fraction_non_alphanumeric': 0.1504959034066408, 'fraction_numerical': 0.022135978151502086, 'mean_word_length': 4.150259067357513, 'pattern_counts': {'":': 0, '<': 157, '<?xml version=': 0, '>': 157, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1230324', 'n_tokens_mistral': 2452, 'n_tokens_neox': 2243, 'n_words': 714}