Skip to content

A simple extension to add support to ComponentKit for POP animations.

License

Notifications You must be signed in to change notification settings

crylico/CKComponentPOPAnimation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CKComponentPOPAnimation

A simple extension to add support to ComponentKit for POP animations. This extension relies on NSCopying adherance for POPAnimation and its subclasses, which is not yet in a version release, but is live in the POP's master branch.

##Get Started

Once you have POP and ComponentKit in your project, simply include the CKComponentPOPAnimation files in your project.

At this point, you'll need to either use the 'bleeding edge' instructions for POP or manually embed the framework into your project until a new version release is made for CocoaPods.

##Usage

- (std::vector<CKComponentAnimation>)animationsFromPreviousComponent:(CKComponent *)previousComponent {
    
    CKComponent *component = ...; (self, subcomponent, etc.)

	// Create a POP animation exactly as you normally would.
    POPSpringAnimation *rotationAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPLayerRotation];
    rotate.fromValue = @(M_PI);
    rotate.toValue = @(M_PI_2);
    rotate.springSpeed = 5;
    rotate.springBounciness = 10;

	// 	Return a vector containing the CKComponentPOPAnimation constructor.
    return {CKComponentPOPAnimation(component, rotationAnimation, YES)}; // YES for layer animation (kPOPLayerRotation)
}

About

A simple extension to add support to ComponentKit for POP animations.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published