Top Related Projects
MBProgressHUD + Customizations
ProgressHUD is a lightweight and easy-to-use HUD for iOS. Over 5000+ animations. ‼️
A clean and lightweight progress HUD for your iOS and tvOS app.
A beautiful activity indicator and modal alert written in Swift (originally developed for my app DoodleDoodle) Using blur effects, translucency, flat and bold design - all iOS 8 latest and greatest
A Swift Autolayout DSL for iOS & OS X
Quick Overview
NVActivityIndicatorView is a collection of awesome loading animations for iOS applications. It provides a wide variety of customizable activity indicators, making it easy for developers to add engaging loading animations to their apps. The library is written in Swift and offers a simple API for integration.
Pros
- Large selection of animation styles (over 30 different types)
- Highly customizable (color, size, padding, etc.)
- Easy to integrate and use in iOS projects
- Regularly updated and maintained
Cons
- Limited to iOS platform only
- May increase app size due to numerous animation assets
- Some animations might be resource-intensive for older devices
- Learning curve for advanced customizations
Code Examples
- Basic usage:
let activityIndicator = NVActivityIndicatorView(frame: CGRect(x: 0, y: 0, width: 40, height: 40), type: .ballSpinFadeLoader, color: .white, padding: 0)
view.addSubview(activityIndicator)
activityIndicator.startAnimating()
- Customizing appearance:
let activityIndicator = NVActivityIndicatorView(frame: CGRect(x: 0, y: 0, width: 50, height: 50),
type: .ballPulse,
color: .red,
padding: 10)
activityIndicator.backgroundColor = .black
- Using with UIViewController extension:
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
startAnimating(type: .ballRotateChase, color: .blue, backgroundColor: .black.withAlphaComponent(0.5))
}
}
Getting Started
-
Install via CocoaPods by adding to your Podfile:
pod 'NVActivityIndicatorView'
-
Import the library in your Swift file:
import NVActivityIndicatorView
-
Create and use an activity indicator:
let frame = CGRect(x: 0, y: 0, width: 40, height: 40) let activityIndicator = NVActivityIndicatorView(frame: frame, type: .ballPulse) view.addSubview(activityIndicator) activityIndicator.startAnimating()
-
To stop the animation:
activityIndicator.stopAnimating()
Competitor Comparisons
MBProgressHUD + Customizations
Pros of MBProgressHUD
- Simpler API and easier to implement for basic use cases
- Lightweight and focused on core progress HUD functionality
- Longer history and more widespread adoption in iOS development
Cons of MBProgressHUD
- Limited animation styles compared to NVActivityIndicatorView
- Less customization options for appearance and behavior
- Primarily designed for iOS, while NVActivityIndicatorView supports both iOS and tvOS
Code Comparison
MBProgressHUD:
let hud = MBProgressHUD.showAdded(to: view, animated: true)
hud.label.text = "Loading..."
hud.hide(animated: true, afterDelay: 3.0)
NVActivityIndicatorView:
let activityIndicator = NVActivityIndicatorView(frame: CGRect(x: 0, y: 0, width: 40, height: 40), type: .ballSpinFadeLoader, color: .white, padding: 0)
view.addSubview(activityIndicator)
activityIndicator.startAnimating()
Both libraries provide easy-to-use progress indicators, but NVActivityIndicatorView offers more animation types and customization options. MBProgressHUD is more focused on traditional HUD-style indicators, while NVActivityIndicatorView provides a wider range of modern, visually appealing loading animations. The choice between the two depends on the specific requirements of your project and the desired visual style.
ProgressHUD is a lightweight and easy-to-use HUD for iOS. Over 5000+ animations. ‼️
Pros of ProgressHUD
- Simpler API with fewer configuration options, making it easier to use for basic scenarios
- Includes built-in success and error states with icons, reducing the need for custom implementations
- Lighter weight with fewer dependencies, potentially leading to a smaller app size
Cons of ProgressHUD
- Less customizable compared to NVActivityIndicatorView, with fewer animation options
- Limited to a single style of progress indicator, while NVActivityIndicatorView offers multiple types
- May not be as visually appealing or modern-looking as NVActivityIndicatorView's animations
Code Comparison
ProgressHUD:
ProgressHUD.show("Loading...")
// Later
ProgressHUD.dismiss()
NVActivityIndicatorView:
let activityIndicator = NVActivityIndicatorView(frame: CGRect(x: 0, y: 0, width: 40, height: 40), type: .ballSpinFadeLoader, color: .white, padding: 0)
view.addSubview(activityIndicator)
activityIndicator.startAnimating()
// Later
activityIndicator.stopAnimating()
ProgressHUD offers a more straightforward API for basic use cases, while NVActivityIndicatorView provides more granular control over the indicator's appearance and behavior. The choice between the two depends on the specific requirements of your project, balancing simplicity with customization needs.
A clean and lightweight progress HUD for your iOS and tvOS app.
Pros of SVProgressHUD
- Simpler API and easier to implement for basic use cases
- Lightweight and focused on progress HUD functionality
- Well-established and widely used in iOS development community
Cons of SVProgressHUD
- Limited customization options compared to NVActivityIndicatorView
- Fewer animation styles available
- Less actively maintained in recent years
Code Comparison
SVProgressHUD:
SVProgressHUD.show()
SVProgressHUD.showProgress(0.5)
SVProgressHUD.dismiss()
NVActivityIndicatorView:
let activityIndicator = NVActivityIndicatorView(frame: CGRect(x: 0, y: 0, width: 40, height: 40), type: .ballPulse, color: .white, padding: 0)
view.addSubview(activityIndicator)
activityIndicator.startAnimating()
activityIndicator.stopAnimating()
SVProgressHUD offers a more straightforward API for basic progress HUD functionality, while NVActivityIndicatorView provides greater flexibility and customization options. SVProgressHUD is easier to implement for simple use cases, but NVActivityIndicatorView offers a wider range of animation styles and more control over the appearance and behavior of the activity indicator.
NVActivityIndicatorView is more actively maintained and offers more modern features, making it a better choice for projects requiring extensive customization or a variety of animation styles. However, SVProgressHUD remains a solid option for developers seeking a simple, lightweight solution for displaying progress indicators in iOS applications.
A beautiful activity indicator and modal alert written in Swift (originally developed for my app DoodleDoodle) Using blur effects, translucency, flat and bold design - all iOS 8 latest and greatest
Pros of SwiftSpinner
- Simpler API with fewer configuration options, making it easier to use for basic loading indicators
- Built-in support for success and failure states with customizable messages
- Lightweight and focused solely on a single spinner style
Cons of SwiftSpinner
- Limited customization options compared to NVActivityIndicatorView
- Fewer animation types available (only one spinner style)
- Less actively maintained, with fewer recent updates
Code Comparison
SwiftSpinner:
SwiftSpinner.show("Loading...")
SwiftSpinner.hide()
NVActivityIndicatorView:
let activityIndicator = NVActivityIndicatorView(frame: CGRect(x: 0, y: 0, width: 40, height: 40), type: .ballSpinFadeLoader)
view.addSubview(activityIndicator)
activityIndicator.startAnimating()
activityIndicator.stopAnimating()
SwiftSpinner offers a more straightforward API for basic usage, while NVActivityIndicatorView provides more flexibility and customization options. SwiftSpinner is better suited for quick implementations with minimal setup, whereas NVActivityIndicatorView is ideal for projects requiring diverse loading animations and fine-grained control over the indicator's appearance and behavior.
A Swift Autolayout DSL for iOS & OS X
Pros of SnapKit
- Focuses on Auto Layout, providing a powerful and expressive DSL for creating constraints
- Widely adopted in the iOS development community, with extensive documentation and community support
- Simplifies complex layout code, making it more readable and maintainable
Cons of SnapKit
- Limited to layout functionality, unlike NVActivityIndicatorView which provides specific UI components
- Steeper learning curve for developers new to Auto Layout concepts
- May require additional libraries for specific UI elements or animations
Code Comparison
SnapKit:
view.snp.makeConstraints { make in
make.center.equalToSuperview()
make.width.height.equalTo(200)
}
NVActivityIndicatorView:
let activityIndicator = NVActivityIndicatorView(frame: CGRect(x: 0, y: 0, width: 40, height: 40), type: .ballPulse, color: .white, padding: 0)
view.addSubview(activityIndicator)
activityIndicator.startAnimating()
While SnapKit focuses on creating layout constraints, NVActivityIndicatorView provides ready-to-use activity indicators. SnapKit offers more flexibility in positioning and sizing UI elements, whereas NVActivityIndicatorView specializes in creating and customizing loading animations.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
NVActivityIndicatorView
â ï¸ Check out LoaderUI (ready to use with Swift Package Mananger supported) for SwiftUI implementation of this. ð
Introduction
NVActivityIndicatorView
is a collection of awesome loading animations.
Animation types
Type | Type | Type | Type |
---|---|---|---|
1. ballPulse | 2. ballGridPulse | 3. ballClipRotate | 4. squareSpin |
5. ballClipRotatePulse | 6. ballClipRotateMultiple | 7. ballPulseRise | 8. ballRotate |
9. cubeTransition | 10. ballZigZag | 11. ballZigZagDeflect | 12. ballTrianglePath |
13. ballScale | 14. lineScale | 15. lineScaleParty | 16. ballScaleMultiple |
17. ballPulseSync | 18. ballBeat | 19. lineScalePulseOut | 20. lineScalePulseOutRapid |
21. ballScaleRipple | 22. ballScaleRippleMultiple | 23. ballSpinFadeLoader | 24. lineSpinFadeLoader |
25. triangleSkewSpin | 26. pacman | 27. ballGridBeat | 28. semiCircleSpin |
29. ballRotateChase | 30. orbit | 31. audioEqualizer | 32. circleStrokeSpin |
Installation
Cocoapods
Cocoapods is a dependency manager for Swift and Objective-C Cocoa projects. To use NVActivityIndicatorView with CocoaPods, add it in your Podfile
.
pod 'NVActivityIndicatorView'
Carthage
Carthage is intended to be the simplest way to add frameworks to your Cocoa application. To use NVActivityIndicatorView with Carthage, add it in your Cartfile
.
github "ninjaprox/NVActivityIndicatorView"
Swift Package Manager
The Swift Package Manager is a tool for managing the distribution of Swift code. To use NVActivityIndicatorView with Swift Package Manger, add it to dependencies
in your Package.swift
dependencies: [
.package(url: "https://github.com/ninjaprox/NVActivityIndicatorView.git")
]
Migration
Version 5.0.0 comes with breaking changes. Please refer to the release note for details.
Usage
Firstly, import NVActivityIndicatorView
.
import NVActivityIndicatorView
Initialization
Then, there are two ways you can create NVActivityIndicatorView
:
- By storyboard, changing class of any
UIView
toNVActivityIndicatorView
.
Note: Set Module
to NVActivityIndicatorView
.
- By code, using initializer. All parameters other than
frame
are optional andNVActivityIndicatorView.DEFAULT_*
are used as default values.
NVActivityIndicatorView(frame: frame, type: type, color: color, padding: padding)
Control
Start animating.
activityIndicatorView.startAnimating()
Stop animating.
activityIndicatorView.stopAnimating()
Determine if it is animating.
animating = activityIndicatorView.isAnimating
Change properties
In storyboard, you can change all properties in Attributes inspector tab of Utilities panel.
Note: Use one of values (case-insensitive) in Animation types for Type Name
.
All properties are public so you can change them after initializing.
Note: All changes must be made before calling startAnimating()
.
Documentation
https://nvactivityindicatorview.vinhis.me/
Acknowledgment
Thanks Connor Atherton for inspired Loaders.css and Danil Gontovnik for DGActivityIndicatorView.
License
The MIT License (MIT)
Copyright (c) 2016 Vinh Nguyen @ninjaprox
Top Related Projects
MBProgressHUD + Customizations
ProgressHUD is a lightweight and easy-to-use HUD for iOS. Over 5000+ animations. ‼️
A clean and lightweight progress HUD for your iOS and tvOS app.
A beautiful activity indicator and modal alert written in Swift (originally developed for my app DoodleDoodle) Using blur effects, translucency, flat and bold design - all iOS 8 latest and greatest
A Swift Autolayout DSL for iOS & OS X
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot