Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

keyPath property animations #274

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

naftaly
Copy link

@naftaly naftaly commented Sep 17, 2015

Added keyPath to POPPropertyAnimation

This enables POPPropertyAnimation.property to be automatically filled in by the engine instead of having to enter it yourself.

POPPropertyAnimation *anim = [POPPropertyAnimation animationForKeyPath:@"contentOffset"];
// ... setup your animation
[table pop_addAnimation:anim forKey:@"someKey"];

That code will have the engine first check the object it was added to for a method named animationPropertyForContentOffset. If found, it will be called to fill in the property. If not, the engine will then call [object valueForKeyPath:keyPath] in order to figure out what kind of value should be passed around. Then it sets up the property for that that type of value.

Slipped in GLKit data type support

2 new types were added, GLKVector3 and GLKQuaternion. GLKVector3 can be used everywhere and GLKQuaternion can be used everywhere except for velocities.

@naftaly naftaly mentioned this pull request Sep 21, 2015
Copy link
Contributor

@b3ll b3ll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty rad. The only thing I'm concerned with is the overhead introduced by executing -valueForKeyPath: every frame (rather than directly accessing the property itself). It's not a major concern, but I'd rather -animationForKeyPath: not become the default use-case.

// Created by Alexander Cohen on 2015-09-16.
// Copyright © 2015 Facebook. All rights reserved.
//

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we get this header setup to be the same as the other headers? :D

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taken care of in f55f93c

[(CALayer*)[layer expect] setPosition:FBTestInterpolateLinear(Vector2r([anim.fromValue CGPointValue]), Vector2r([anim.toValue CGPointValue]), 0.25).cg_point()];
[(CALayer*)[layer expect] setPosition:FBTestInterpolateLinear(Vector2r([anim.fromValue CGPointValue]), Vector2r([anim.toValue CGPointValue]), 0.5).cg_point()];
[(CALayer*)[layer expect] setPosition:FBTestInterpolateLinear(Vector2r([anim.fromValue CGPointValue]), Vector2r([anim.toValue CGPointValue]), 0.75).cg_point()];
[(CALayer*)[layer expect] setPosition:[anim.toValue CGPointValue]];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for updating these!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants