Convert Figma logo to code with AI

schneiderandre logopopping

A collection of animation examples for iOS apps.

5,539
672
5,539
4

Top Related Projects

19,660

An extensible iOS and OS X animation library, useful for physics-based interactions.

A toolkit for building responsive motion using Core Animation.

An iOS library to natively render After Effects vector animations

Nice library to show placeholders and Empty States for any UITableView/UICollectionView in your project

14,077

A library to simplify iOS animations in Swift.

Design and prototype customized UI, interaction, navigation, transition and animation for App Store ready Apps in Interface Builder with IBAnimatable.

Quick Overview

Popping is a collection of animation examples for iOS, demonstrating various animation techniques using UIKit and Core Animation. It serves as a reference and learning resource for iOS developers looking to implement engaging animations in their applications.

Pros

  • Comprehensive collection of animation examples
  • Well-organized and easy to navigate
  • Includes both simple and complex animation techniques
  • Provides a practical learning resource for iOS developers

Cons

  • Last updated in 2015, potentially outdated for newer iOS versions
  • Limited documentation and explanations for each animation
  • No Swift examples, only Objective-C
  • Lacks integration with modern iOS frameworks like SwiftUI

Code Examples

Here are a few code examples from the Popping repository:

  1. Basic view animation:
[UIView animateWithDuration:0.5 animations:^{
    self.view.alpha = 0.0;
}];

This code animates the alpha property of a view, fading it out over 0.5 seconds.

  1. Spring animation:
[UIView animateWithDuration:0.5
                      delay:0.0
     usingSpringWithDamping:0.5
      initialSpringVelocity:0.8
                    options:0
                 animations:^{
                     self.view.center = CGPointMake(200, 200);
                 }
                 completion:nil];

This code uses a spring animation to move a view to a new center point with a bouncy effect.

  1. CAKeyframeAnimation example:
CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"position.x"];
animation.values = @[@0, @10, @-10, @10, @0];
animation.keyTimes = @[@0, @(1 / 6.0), @(3 / 6.0), @(5 / 6.0), @1];
animation.duration = 0.4;
animation.additive = YES;

[self.view.layer addAnimation:animation forKey:@"shake"];

This code creates a shaking animation using CAKeyframeAnimation, moving the view horizontally in a back-and-forth motion.

Getting Started

To use the Popping examples in your project:

  1. Clone the repository: git clone https://github.com/schneiderandre/popping.git
  2. Open the Xcode project file in the cloned directory
  3. Explore the various animation examples in the project structure
  4. Copy the relevant animation code into your own project and modify as needed

Note that you may need to update some code to work with newer iOS versions or convert it to Swift if you're not using Objective-C.

Competitor Comparisons

19,660

An extensible iOS and OS X animation library, useful for physics-based interactions.

Pros of Pop

  • Developed and maintained by Facebook, ensuring high-quality and well-tested code
  • More comprehensive animation framework with a wider range of features
  • Better documentation and community support due to its popularity

Cons of Pop

  • Larger codebase, which may lead to increased app size
  • Steeper learning curve for beginners due to its extensive feature set
  • Less frequently updated, as it's now archived

Code Comparison

Pop:

POPSpringAnimation *anim = [POPSpringAnimation animationWithPropertyNamed:kPOPViewScaleXY];
anim.toValue = [NSValue valueWithCGSize:CGSizeMake(2.0, 2.0)];
anim.springBounciness = 20.0f;
[view pop_addAnimation:anim forKey:@"scale"];

Popping:

[UIView animateWithDuration:0.5
                 animations:^{
                     view.transform = CGAffineTransformMakeScale(2.0, 2.0);
                 }
                 completion:nil];

Pop offers more granular control over animations, while Popping provides a simpler API for basic animations. Pop's code is more verbose but allows for fine-tuning of animation properties, whereas Popping relies on UIKit's built-in animation methods for a more straightforward approach.

A toolkit for building responsive motion using Core Animation.

Pros of Material Motion Swift

  • More comprehensive motion system with a wider range of animation capabilities
  • Active development and maintenance, with recent updates and contributions
  • Better documentation and examples for easier integration

Cons of Material Motion Swift

  • Steeper learning curve due to its more complex architecture
  • Potentially heavier resource usage for simpler animation tasks
  • Less focused on specific pop animations compared to Popping

Code Comparison

Popping:

let animation = POPSpringAnimation(propertyNamed: kPOPViewScaleXY)
animation.toValue = NSValue(cgSize: CGSize(width: 1.5, height: 1.5))
animation.springBounciness = 10
view.pop_add(animation, forKey: "scale")

Material Motion Swift:

let plan = SpringTo<CGPoint>(destination: CGPoint(x: 100, y: 100))
let animation = Motion(view: view, plan: plan)
animation.start()

Both libraries offer ways to create spring animations, but Material Motion Swift provides a more abstracted approach with its plan-based system, while Popping offers a more direct manipulation of properties.

An iOS library to natively render After Effects vector animations

Pros of Lottie-iOS

  • Supports complex animations created in Adobe After Effects
  • Offers a wide range of customization options for animations
  • Actively maintained with frequent updates and improvements

Cons of Lottie-iOS

  • Larger file size and potentially higher memory usage
  • Steeper learning curve for designers and developers
  • May require additional tools or plugins for creating animations

Code Comparison

Popping (using pop animations):

let animation = POPSpringAnimation(propertyNamed: kPOPViewScale)
animation.toValue = NSValue(cgPoint: CGPoint(x: 1.5, y: 1.5))
animation.springBounciness = 10
view.pop_add(animation, forKey: "scale")

Lottie-iOS (using JSON-based animations):

let animationView = AnimationView(name: "animation")
animationView.frame = view.bounds
animationView.contentMode = .scaleAspectFit
view.addSubview(animationView)
animationView.play()

Summary

Popping focuses on simple, code-based animations using the POP framework, while Lottie-iOS enables complex, designer-friendly animations created in After Effects. Popping is lightweight and easy to implement but limited in complexity, whereas Lottie-iOS offers more advanced features at the cost of increased complexity and resource usage.

Nice library to show placeholders and Empty States for any UITableView/UICollectionView in your project

Pros of HGPlaceholders

  • Focuses specifically on placeholder views for UITableView and UICollectionView
  • Provides customizable placeholder styles and animations
  • Supports both Swift and Objective-C

Cons of HGPlaceholders

  • Limited to placeholder functionality for table and collection views
  • Less versatile compared to Popping's wide range of UI animations
  • Smaller community and fewer contributors

Code Comparison

HGPlaceholders:

tableView.placeholderDelegate = self
tableView.showLoadingPlaceholder()

Popping:

POPSpringAnimation *anim = [POPSpringAnimation animationWithPropertyNamed:kPOPViewScaleXY];
anim.toValue = [NSValue valueWithCGPoint:CGPointMake(1.5, 1.5)];
[view pop_addAnimation:anim forKey:@"scale"];

HGPlaceholders is tailored for creating placeholder views in UITableView and UICollectionView, offering a simple API for displaying loading, error, or no-results states. It's ideal for developers focusing on these specific UI components.

Popping, on the other hand, is a more general-purpose animation library. It provides a wide range of customizable animations for various UI elements, making it suitable for developers looking to add dynamic and interactive animations throughout their app.

While HGPlaceholders excels in its niche, Popping offers greater flexibility for diverse animation needs across different UI components.

14,077

A library to simplify iOS animations in Swift.

Pros of Spring

  • More comprehensive animation framework with a wider range of features
  • Active development and maintenance, with recent updates
  • Extensive documentation and examples available

Cons of Spring

  • Steeper learning curve due to more complex API
  • Larger codebase and potentially higher overhead

Code Comparison

Spring:

let animation = spring(duration: 0.5, delay: 0, type: .spring) {
    view.transform = CGAffineTransform(scaleX: 1.5, y: 1.5)
}
animation.animate()

Popping:

[UIView animateWithDuration:0.5 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
    view.transform = CGAffineTransformMakeScale(1.5, 1.5);
} completion:nil];

Key Differences

  • Spring is written in Swift, while Popping is in Objective-C
  • Spring offers a more declarative syntax for animations
  • Popping relies on UIKit's built-in animation methods
  • Spring provides more customization options for animations

Use Cases

  • Spring: Complex, chained animations with fine-grained control
  • Popping: Simple, quick animations with minimal setup

Community and Support

  • Spring has a larger community and more recent activity
  • Popping has been relatively inactive in recent years

Design and prototype customized UI, interaction, navigation, transition and animation for App Store ready Apps in Interface Builder with IBAnimatable.

Pros of IBAnimatable

  • More comprehensive animation and UI design capabilities
  • Supports both code-based and Interface Builder-based implementations
  • Actively maintained with regular updates and a larger community

Cons of IBAnimatable

  • Steeper learning curve due to more extensive features
  • May be overkill for simple animation needs
  • Requires iOS 8.0 or later, while Popping supports iOS 6.0+

Code Comparison

IBAnimatable:

let view = AnimatableView()
view.animate(.pop(repeatCount: 1))

Popping:

POPSpringAnimation *anim = [POPSpringAnimation animationWithPropertyNamed:kPOPLayerScaleXY];
anim.toValue = [NSValue valueWithCGSize:CGSizeMake(1.1, 1.1)];
[view.layer pop_addAnimation:anim forKey:@"pop"];

Summary

IBAnimatable offers a more comprehensive set of animation and UI design tools, with support for both code and Interface Builder implementations. It's actively maintained but may have a steeper learning curve. Popping, while simpler, provides a lightweight solution for basic animations and has broader iOS version support. The choice between the two depends on project requirements and complexity.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

popping

Popping is a collection of animation examples for iOS apps. Almost all of them were created using the Facebook pop animation engine. It should inspire you to create some great looking UIs to delight people who use your app.

popping

Watch this video to see all animations in action. In addition, here is the video of the folding animation that was added later.

Get your hands dirty

Clone or download the repository, build and run and start playing with the animations.

Are you interested in some Classes?

Great! Just let me know what classes you'd like to use and I will create a library and release it as a CocoaPod.

Contact

I would love to get some feedback, ideas for improvements or new animations that should be included in this project.

I would also greatly appreciate if you follow me on twitter.

Author

André Schneider, @_schneiderandre