NVActivityIndicatorView
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
-
ballPulse
-
ballGridPulse
-
ballClipRotate
-
squareSpin
-
ballClipRotatePulse
-
ballClipRotateMultiple
-
ballPulseRise
-
ballRotate
-
cubeTransition
-
ballZigZag
-
ballZigZagDeflect
-
ballTrianglePath
-
ballScale
-
lineScale
-
lineScaleParty
-
ballScaleMultiple
-
ballPulseSync
-
ballBeat
-
lineScalePulseOut
-
lineScalePulseOutRapid
-
ballScaleRipple
-
ballScaleRippleMultiple
-
ballSpinFadeLoader
-
lineSpinFadeLoader
-
triangleSkewSpin
-
pacman
-
ballGridBeat
-
semiCircleSpin
-
ballRotateChase
-
orbit
-
audioEqualizer
-
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