Skip to content

Commit

Permalink
Release 0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewcheok committed May 4, 2014
1 parent 4e3790a commit 9a8bdfb
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 7 deletions.
2 changes: 1 addition & 1 deletion POP+MCAnimate.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'POP+MCAnimate'
s.version = '0.1'
s.version = '0.2'
s.platform = :ios, '7.0'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.summary = 'Concise syntax for the Pop animation framework.'
Expand Down
68 changes: 62 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,76 @@ With this:

self.boxView.spring.bounds = CGRectMake(0, 0, 200, 200);

## Additional Configuration
### Spring Animation

The animation proxies `spring`, `decay`, `linear`, `easeIn`, `easeOut` and `easeInEaseOut` are provided on `NSObject`. You can set the `toValue` of the animation by setting properties on these proxies.
You can configure `velocity`, `springBounciness` and `springSpeed`.

In addition, there is a `velocity` proxy to take velocities values for spring and decay animations. Velocities expire after one animation. Additional properties `springBounciness` and `springSpeed` are provided on `NSObject` for spring animations and `decayDeceleration` for decay animations.
self.boxView.velocity.center = [pan velocityInView:self.boxView];
self.boxView.springBounciness = 20;
self.boxView.springSpeed = 20;
self.boxView.spring.center = viewCenter;

Because decay animations take no `toValue`, they are created as follows:
### Decay Animation

self.boxView.velocity.center = CGPointMake(100, 100);
You can configure `velocity` and `decayDeceleration`.

self.boxView.velocity.center = [pan velocityInView:self.boxView];
self.boxView.decayDeceleration = 0.998;
[self.boxView.decay center];

### Basic Animation

You can configure `duration` and use different timing functions by swapping out `easeInEaseOut` for `easeIn`, `easeOut` or `linear`.

self.boxView.duration = 1;
self.boxView.easeInEaseOut.center = viewCenter;


### Grouping and Completion Handlers

Block-based methods are provided on `NSObject` similar to UIKit block-based animation methods. The `completion` block waits for all animations in the `animate` block to complete before executing.

[NSObject animate:^{
self.boxView.spring.alpha = 0.5;
self.boxView.spring.bounds = CGRectMake(0, 0, 200, 200);
self.boxView.spring.backgroundColor = [UIColor blueColor];
} completion:^(BOOL finished) {
self.boxView.alpha = 1;
self.boxView.spring.bounds = CGRectMake(0, 0, 100, 100);
self.boxView.spring.backgroundColor = [UIColor redColor];
self.boxView.spring.center = viewCenter;
}];

## Remarks

Currently only Pop animatable properties that correspond directly to `UIView` and `CALayer` properties are supported.
Currently only Pop animatable properties that correspond directly to UIKit properties are supported.

The list of supported properties are:
- **CALayer** (and subclasses)
- backgroundColor
- bounds
- opacity
- position
- zPosition

- **CAShapeLayer**
- strokeColor
- strokeStart
- strokeEnd

- **NSLayoutConstraint**
- constant

- **UIView** (and subclasses)
- alpha
- backgroundColor
- bounds
- center
- frame

- **UIScrollView** (and subclasses)
- contentOffset
- contentSize

## License

Expand Down

0 comments on commit 9a8bdfb

Please sign in to comment.