Every app we build requires a loading animation. We like having fun with this and develop a unique style that fits with the app's UI.
After seeing the updated Gmail app for iOS, I fell in love with the simplicity of their loading animation.
I decided to develop this animation and share it on GitHub. You can add this to any iOS project just by adding the
.m file to Xcode. Special thanks to Voyce Ian's post on flip-clock which helped me develop the flipping.
For rotating the alternate side i used core animation (i.e. CABasicAnimation and its delegate method). Once the rotation completes, I look for next set of colors from color Array and apply it on both the views.
How to use the animation:
Add "QuartzCore.framework" to your Xcode project.
Drag GmailLikeLoadingView.h and GmailLikeLoadingView.m files to your project.
Initialize GmailLikeLoadingView, change its frame according to your need and add it as a subview.
To start and stop flipping loading call startAnimating and stopAnimating. You can use isAnimating to check the status of this animation.