Introduction to POP animation engine. POP drives all the animations and transitions in Facebook's Paper application.
POP reference link: https://github.com/facebook/pop
Sample iOS Project: https://github.com/subhransu/PopAnimation-Sample
2. what’s pop
• An animation engine for iOS and OSX
• It supports spring and dynamic animations
• Useful for realistic and physic based interactions
• Facebook used it extensibly in their Paper app
4. installation
• Recommended way of installing pop is to use
CocoaPods
• pod 'pop', '~> 1.0’
• Ensure -lc++ linker flag is set for manual installation
5. installation
• To install Cocoapods
!
$ sudo gem install cocoapods
• Create Podfile file in your Xcode project and write
!
platform: iOS, ‘7.0'
pod 'pop', '~> 1.0’
• Install your dependencies
!
$ pod install
• Make sure you open the Xcode workspace instead of the
project file
!
$ open App.xcworkspace
!
!
6. using pop
• Import the header file
!
#import <POP/POP.h>
• To start an animation add it to an object
// sample code
POPSpringAnimation *anim = [POPSpringAnimation
animation];
…
!
[layer pop_addAnimation:anim forKey:@"myKey"];
7. using pop
• To stop an animation
!
[layer pop_removeAnimationForKey:@"myKey"];
!
• Check existence of an animation using key
!
// Sample code
!
anim = [layer pop_animationForKey:@"myKey"];
!
if (anim) {
// Do something
}