Guide · Open source
How to use NVActivityIndicatorView: install and show loaders in iOS
Updated · written with AI from the project's own documentation and checked against our catalogue data
NVActivityIndicatorView is an open-source Swift library that provides a collection of loading animations for iOS apps, such as pulsing balls, spinning squares and a pacman-style loader. This guide is for iOS developers using UIKit who want a ready-made loading indicator. By the end you will be able to install the library, add an indicator in Interface Builder or code, and start, stop and customise it.
Quick start
- 1Install the library. Add pod 'NVActivityIndicatorView' to your Podfile, or use Carthage or Swift Package Manager as described in the install section.
- 2Import the module. Add import NVActivityIndicatorView at the top of the Swift file that uses it.
- 3Create the indicator. Add a UIView set to NVActivityIndicatorView in storyboard with Module set to NVActivityIndicatorView, or create it with the initializer in code.
- 4Pick an animation type. Set the type to one of the 32 names, such as ballPulse or pacman.
- 5Start the animation. Call startAnimating() when loading begins.
- 6Stop the animation. Call stopAnimating() when loading finishes.
What NVActivityIndicatorView is and who it suits
NVActivityIndicatorView is a collection of loading animations for iOS. You show one while content is loading, so users see that the app is working. It is licensed under MIT and written in Swift.
It suits UIKit-based iOS apps. The README points to a separate project, LoaderUI, for SwiftUI support, so SwiftUI projects should look there instead. The library is iOS-only.
- Good fit: iOS developers who want many ready-made loading styles.
- Good fit: Swift projects that already use CocoaPods, Carthage or Swift Package Manager.
- Not a fit: SwiftUI projects, Android or web projects, or teams that need a fully custom animation.
Install NVActivityIndicatorView with CocoaPods, Carthage or Swift Package Manager
Choose the dependency manager your project already uses. You need Xcode and one of CocoaPods, Carthage or Swift Package Manager.
With CocoaPods, add the pod to your Podfile.
With Carthage, add the GitHub entry to your Cartfile.
With Swift Package Manager, add the package URL to dependencies in your Package.swift.
pod 'NVActivityIndicatorView'
github "ninjaprox/NVActivityIndicatorView"
dependencies: [
.package(url: "https://github.com/ninjaprox/NVActivityIndicatorView.git")
]Add an indicator in Interface Builder or in code
Start by importing the library in the Swift file where you use it.
In storyboard, change the class of any UIView to NVActivityIndicatorView. Set its Module to NVActivityIndicatorView.
In code, use the initializer. Every parameter except frame is optional, and the library's DEFAULT_* values are used when you leave one out. The parameters are frame, type, color and padding.
import NVActivityIndicatorView
NVActivityIndicatorView(frame: frame, type: type, color: color, padding: padding)Choose an animation type
The library includes 32 animation types. Use the name (case-insensitive) as the Type Name in storyboard, or pass the matching type in code. Some examples from the list are ballPulse, squareSpin, pacman, orbit and audioEqualizer.
- 1. ballPulse
- 2. ballGridPulse
- 4. squareSpin
- 26. pacman
- 30. orbit
- 31. audioEqualizer
- 32. circleStrokeSpin
Start, stop and check the animation
Call startAnimating() to begin the animation and stopAnimating() to end it. To check whether it is running, read the isAnimating property.
activityIndicatorView.startAnimating()
activityIndicatorView.stopAnimating()
animating = activityIndicatorView.isAnimatingChange properties before starting
All properties are public, so you can change them after initializing the view. In storyboard, use the Attributes inspector tab of the Utilities panel.
Make all property changes before calling startAnimating(). The README states this requirement directly.
What people use it for
- Showing a ballPulse or pacman loader while a screen fetches data in a UIKit app.
- Placing a small spinning indicator such as squareSpin inside a button or list while an action runs.
- Trying different animation types in storyboard to match the look of an app without building animations from scratch.
Frequently asked questions
Is NVActivityIndicatorView free to use?
Yes, the library is released under the MIT License, as stated in the README. The license text names Vinh Nguyen as the copyright holder. Check the license file in the repository for the full terms.
How do I install NVActivityIndicatorView?
The README lists three options: CocoaPods, Carthage and Swift Package Manager. For CocoaPods, add pod 'NVActivityIndicatorView' to your Podfile. For Carthage, add github "ninjaprox/NVActivityIndicatorView" to your Cartfile.
Does NVActivityIndicatorView work with SwiftUI?
The README does not cover SwiftUI. It points to a separate project, LoaderUI, which it describes as ready to use with Swift Package Manager for a SwiftUI implementation of this library.
How many animation types are there?
There are 32 animation types, such as ballPulse, squareSpin, pacman and orbit. Use one of the names from the Animation types list in the README.
Can I change the color or other properties after creating the indicator?
Yes. All properties are public, so you can change them after initializing. Make the changes before calling startAnimating(), because the README says all changes must be made before that call.
What are the alternatives to NVActivityIndicatorView?
The README credits Loaders.css and DGActivityIndicatorView as inspirations. SkeletonView is a comparable project for loading placeholders. Compare them on the animation styles and platform you need.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
NVActivityIndicatorView suits iOS developers working in UIKit who want many ready-made loading animations with little setup. If your project uses SwiftUI, targets Android or the web, or needs a fully custom animation, pick LoaderUI or another tool instead.
Install options & downloads