NVActivityIndicatorView
A collection of awesome loading animations
A Swift library for iOS offering 32 animated loading indicator styles, from pulsing balls to ripple effects, that you can drop into any app with a few lines of code.
NVActivityIndicatorView is a Swift library for iOS that provides a collection of animated loading indicators. When an app is waiting for something, such as fetching data from a server, it typically shows a spinning or pulsing animation to signal that work is happening. This library offers 32 different animation styles so developers can choose one that fits their app's design, rather than using the default system spinner.
The animation types range from pulsing balls and rotating squares to zigzag patterns, ripple effects, and a pacman-style animation. Each has a name like ballPulse, lineScale, orbit, or circleStrokeSpin. You pick one when you create the indicator view.
Adding the library to an iOS project is done through the standard dependency managers: CocoaPods, Carthage, or Swift Package Manager. For a SwiftUI-based app, the README points to a separate companion project called LoaderUI that uses the same animations.
Usage is straightforward. You either set a UIView's class to NVActivityIndicatorView in Interface Builder (the visual layout editor in Xcode), or you create one in code by passing a frame, animation type, color, and padding. You then call startAnimating() when you want the animation to appear and stopAnimating() when it should disappear. All visual properties are public and can be adjusted, but must be set before calling startAnimating.
The project is MIT-licensed and was inspired by a CSS animation library called Loaders.css. Full API documentation is available at nvactivityindicatorview.vinhis.me.
Where it fits
- Replace the default iOS spinner with a custom animation style that matches your app visual design.
- Show a loading indicator in SwiftUI using the companion LoaderUI project with the same animation styles.
- Add a pulsing or orbiting animation to signal background data fetching in a UIKit-based iOS app.