Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction to Facebook Pop

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on. →

Introduction to Facebook Pop

Get an overall idea about iOS animation starting from CA to UIKit to POP with its timing functions, code optimisation and better user experience.
For more details refer to https://github.com/karnikad/PopDemos

Avatar for Karnika Advani

Karnika Advani

May 31, 2017

Other Decks in Programming

Transcript

  1. iOS Apps and Animation CA Animation has been the ancient

    standard since iOS SDK 2 UIKit came along but didn’t have the natural animations until iOS 7+ Lets dive deeper
  2. Basic Animation POPBasicAnimation *anim = [POPBasicAnimation animationWithPropertyNamed:kPOPViewAlpha]; anim.timingFunction = [CAMediaTimingFunction

    functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; anim.fromValue = @(0.0); anim.toValue = @(1.0); [view pop_addAnimation:anim forKey:@"fade"];
  3. Spring Animation POPSpringAnimation *anim = [POPSpringAnimation animationWithPropertyNamed:kPOPViewAlpha]; anim.springBounciness = 15;

    anim.springSpeed = 20; anim.fromValue = @(0.0); anim.toValue = @(1.0); [view pop_addAnimation:anim forKey:@"fade"];
  4. Spring pre iOS7 [UIView animateWithDuration:0.2 animations:^{ view.frame = wayPastFrame; }

    completion:^(BOOL finished){ [UIView animateWithDuration:0.2 animations:^{ view.frame = backBitFrame; } completion:^(BOOL finished){ [UIView animateWithDuration:0.2 animations:^{ view.frame = finalFrame; }] } }] } }];