Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yangmeyer/CPAnimationSequence
Describe multi-step UIView animation sequences declaratively.
https://github.com/yangmeyer/CPAnimationSequence
Last synced: 3 months ago
JSON representation
Describe multi-step UIView animation sequences declaratively.
- Host: GitHub
- URL: https://github.com/yangmeyer/CPAnimationSequence
- Owner: yangmeyer
- License: other
- Created: 2011-07-26T19:10:18.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2015-03-11T11:42:41.000Z (almost 10 years ago)
- Last Synced: 2024-03-14T19:18:01.985Z (11 months ago)
- Language: Objective-C
- Homepage: http://blog.compeople.eu/apps/?p=43
- Size: 252 KB
- Stars: 451
- Watchers: 18
- Forks: 45
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome - CPAnimationSequence - Describe multi-step UIView animation sequences declaratively. (etc)
- awesome - CPAnimationSequence - Describe multi-step UIView animation sequences declaratively. (etc)
README
CPAnimationSequence
===================**Describe multi-step animation sequences declaratively.**
Something like this:
CPAnimationSequence* shakespeare = [CPAnimationSequence sequenceWithSteps:
[CPAnimationStep for:0.2 animate:^{ self.romeo.alpha = 1.0;
self.julia.alpha = 1.0; }],
[CPAnimationStep after:1.0 for:0.7 animate:^{
CGPoint kiss = CGPointMake((self.romeo.center.x + self.julia.center.x)/2,
(self.romeo.center.y + self.julia.center.y)/2);
self.romeo.center = kiss;
self.julia.center = kiss;
}],
[CPAnimationStep after:2.0 for:0.5 animate:[self dramaticDeathAnimationStep]],
[CPAnimationStep for:0.0 animate:^{ self.theEnd.hidden = NO; }],
nil];
[shakespeare runAnimated:YES];I described the rationale and possible improvements on the [compeople developer blog on Mobile Apps](http://blog.compeople.eu/apps/?p=43).
### CPAnimationProgram
With the addition of CPAnimationProgram, you can now also **run steps** (and sequences, and programs) **in parallel**, or **overlap** steps (and sequences, and programs).
This is still somewhat experimental, so you might run into problems with particularly complex overlaps. It does seem to work well, though, so give it a try.
### Composite pattern
The component implements the Composite design pattern, which means that you can **nest sequences and programs** as much as device memory and your sanity allow.
Requirements
-------
* CPAnimationSequence uses [ARC](http://developer.apple.com/library/ios/#releasenotes/ObjectiveC/RN-TransitioningToARC/_index.html). If your project doesn’t use ARC, set the `-fobjc-arc` compiler flag on the CPAnimationSequence source files.
* Deployment target iOS 4.3+ (The demo targets iOS 5.0, but is easily adapted for iOS 4.3).Participate
-------
Feel free to comment, fork, and submit pull requests!Thanks for the contributions from:
- Karsten Litsche
- Matthew McCroskey
- Stephan DiederichLicense
-------
Copyright (c) 2011–2012 compeople AG, 2013 Yang Meyer.The CPAnimationSequence component is released under the [MIT License](https://github.com/yangmeyer/CPAnimationSequence/blob/master/LICENSE.md).