A collection of awesome loading animations

Overview

NVActivityIndicatorView

Build Status Cocoapods Compatible Carthage Compatible

⚠️ 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.

Demo

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 to NVActivityIndicatorView.

Note: Set Module to NVActivityIndicatorView.

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

Comments
  • Aligning problem on XCode 8

    Aligning problem on XCode 8

    I'm having trouble to align the indicator view on storyboard. I have a basic app and single view controller. Indicator is located to the center of view and it spins until the page contents load from the server. However, when I hit the run button, loading indicator is spinning in the right corner of the view, overflowing and not aligning to the center itself.

    Scenario can be replicated by following steps:

    • Add a UIView to a UIViewController on storyboard.
    • Add static height and width and contraints (let say 100,100)
    • Align center vertically and horizontally
    • Change the class of UIView to NVActivityIndicatorView
    • Assign activity type and color.
    • Hit the run button.

    I'm building with XCode 8 and Swift 3.0. Is there any way to fix this?

    Thanks in advance.

    opened by gokhanakkurt 18
  • startAnimating() isn't working initially

    startAnimating() isn't working initially

    Hi, I am using a table view and hitting an api in view did load .Initially when I try to show NVIndicator view it is not showing anything but if I refresh table view then it is working in another api.The code I am using is: NVActivityIndicatorPresenter.sharedInstance.startAnimating(ActivityData()) How to show the loader in viewDidLoad?

    opened by ANKITASRI04 14
  • Xcode8 swift3 problem

    Xcode8 swift3 problem

    i'm using: Xcode8 swift: 3 cocoapods:1.1.0 rc2 NVActivityIndicatorView: 3.0 iPhone7 simulator

    i have other frameworks in pod files, but only NVActivityIndicatorView has following errors when trying to build in Xcode

    Undefined symbols for architecture x86_64: "(extension in NVActivityIndicatorView):NVActivityIndicatorView.NVActivityIndicatorViewable.stopAnimating () -> ()", referenced from: Test.MainViewController.((fetchData in _429C5DB4CBE3D572A146F1757B8C8AAF) () -> ()).(closure #2).(closure #1).(closure #1) in MainViewController.o "(extension in

    opened by skywalkerlw 13
  • Swift 4.2 updates

    Swift 4.2 updates

    Upon installing the Podfile, my project has been littered with 24 issues mostly with renaming changes with the most current version of swift, many of which have been "obsoleted in swift3" based on Xcode.

    opened by BailyTroyer 12
  • error due to animation.setUpAnimation()

    error due to animation.setUpAnimation()

    My app crash because of that function(EXC_BAD_ACCESS):

    animation.setUpAnimation(in: layer, size: animationRect.size, color: color);

    in NVActivityIndicatorView.swift line 456.

    No logs.

    opened by pbeneteau 11
  • Swift 3.0 compiler error

    Swift 3.0 compiler error

    I have got this error after pulling mater branch with pod file. I have used pod 'NVActivityIndicatorView' and got this compiler error.

    'shared' is unavailable: Use view controller based solutions where appropriate instead.
    

    I got this errors on NVActivityIndicatorPresenter line 149, 153 in show / hide methods.

    opened by ghost 10
  • Add delays to start and stop

    Add delays to start and stop

    Hi! It would be awesome to have support for use cases where:

    1. If the time difference between the startActivityAnimating and stopActivityAnimating calls is below certain threshold (e.g 200 ms), then do not display the corresponding NVActivityIndicatorView instance.
    2. Once the NVActivityIndicatorView is shown, have it stay visible for a minimum amount of time in order to avoid fast flashes showing and hiding.

    As a user, I would like to configure those time thresholds as a general setting, but also have the option to override those in particular calls. For instance, if I know that certain network call will last a considerable amount of time, then I would like to show the loading view instantly.

    I could try adding it and then submit a pull request. What do you think?

    opened by dernster 10
  • Added custom animations capability.

    Added custom animations capability.

    Now you can create your own custom animations and feed it into NVActivityIndicatorView!

    To use, conform your custom animation class to NVActivityIndicatorAnimationDelegate and use it:

    startActivityAnimating("Loading...", type: CustomActivityIndicator())
    
    opened by basememara 10
  • Unknown class NVActivityIndicatorView in Interface Builder file

    Unknown class NVActivityIndicatorView in Interface Builder file

    Installing NVActivityIndicatorView using Carthage gives me this error. I've tried most things in these threads: http://stackoverflow.com/questions/33033129/xcode-7-1-swift-2-unknown-class-in-interface-builder-file, http://stackoverflow.com/questions/24924966/xcode-6-strange-bug-unknown-class-in-interface-builder-file ... Any ideas?

    help wanted 
    opened by jacobarvidsson 10
  • Product Module name has changed since 4.5.0 - bug or feature?

    Product Module name has changed since 4.5.0 - bug or feature?

    Hi, Since release 4.5.0 - the product module name has changed from NVActivityIndicatorView to NVActivityIndicatorView_iOS. Not a big deal, but just wondering if this was intentional. I see that tvOS support was added since that version and the product name was changed - that makes me assume that the module name change was not intentional.

    Issues that might occur due to different module name between frameworks - if you share source files between iOS and tvOS - you will not be able to import neither module, unless using conditional compilation.

    Also the current guide in the README is obsolete, as the example there is using the old module name.

    screen shot 2019-01-17 at 16 44 08

    opened by KoCMoHaBTa 9
  • Fatal error: use of unimplemented initializer

    Fatal error: use of unimplemented initializer

    I'm experiencing crashes of the @IBDesignables in Xcode 8 using NVActivityIndicatorView. The crash log shows:

    NVActivityIndicatorView.swift: 333: 20: fatal error: use of unimplemented initializer 'init(frame:) ' for class 'SOGON_TH_Denk.NVActivityIndicatorView'

    Is this known? How do I fix it? Thanks!

    opened by LinusGeffarth 9
  • Stored properties cannot be marked potentially unavailable with '@available'

    Stored properties cannot be marked potentially unavailable with '@available'

    @available(iOS 12.0, *) private lazy var cometLayer: CAGradientLayer = { let shape = CAShapeLayer() shape.path = makeArcPath(radius: radius, startAngle: 0.05, endAngle: 0.95) shape.lineWidth = thickness shape.lineCap = .round shape.strokeColor = UIColor.black.cgColor shape.fillColor = UIColor.clear.cgColor

        let gradientLayer = CAGradientLayer()
        gradientLayer.type = .conic // Conic gradient requires iOS >= 12.0
        gradientLayer.startPoint = CGPoint(x: 0.5, y: 0.5)
        gradientLayer.endPoint = CGPoint(x: 1, y: 0.5)
        gradientLayer.anchorPoint = CGPoint(x: 0.5, y: 0.5)
        gradientLayer.contentsGravity = .center
        gradientLayer.mask = shape
        return gradientLayer
    }()
    
    Screenshot 2022-09-14 at 14 27 42
    opened by Sanjeeb201 0
  • Animation completion handler

    Animation completion handler

    This is a nice library, but animation completion handler would be nice addition. As I can see, we only have isAnimating property, but it would be more handy to have completion handler (eg. I want to hide different elements along with loader).

    Or maybe I am missing something and there is a completion handler actually?

    opened by Wh1rlw1nd 0
  • Cannot compile with Xcode 13b3: 'shared' is unavailable

    Cannot compile with Xcode 13b3: 'shared' is unavailable

    Raising this whilst I'm not sure I'd recommend fixing yet. Follow this thread for a better explanation of the issue.

    The following common code is unavailable in iOS app extensions. Code using this code no longer compiles via SPM.

    UIApplication.shared
    

    Xcode 13b3 is requiring that frameworks use the following annotation for code using unavailable code.

    @available(iOSApplicationExtension, unavailable)
    

    Affected lines of code: https://github.com/ninjaprox/NVActivityIndicatorView/blob/master/Sources/Extended/NVActivityIndicatorPresenter.swift#L309 https://github.com/ninjaprox/NVActivityIndicatorView/blob/master/Sources/Extended/NVActivityIndicatorPresenter.swift#L325

    opened by joshuapoq 1
  • Cannot find 'ActivityData' in scope

    Cannot find 'ActivityData' in scope

    private lazy var activityData : ActivityData = { let size = CGSize(width: 30, height: 30) let activityData = ActivityData(size: size, message: nil, messageFont: nil, messageSpacing: nil, type: NVActivityIndicatorType.ballRotateChase, color: UIColor.white, padding: nil, displayTimeThreshold: nil, minimumDisplayTime: nil, backgroundColor: .clear, textColor: nil) return activityData }()

    opened by zeeshanbiit 0
Releases(5.1.1)
Owner
Vinh Nguyen
Vinh Nguyen
Loading widget based on a Flare animation, allow you to create beautiful custom loading widgets or dialogs

flare_loading Loading widget based on a Flare animation, allow you to create custom loading widgets or dialogs If you're using Rive instead of Flare p

Jimmy Aumard 25 Apr 16, 2021
Shimmer loading - A Flutter project to show how to add shimmer loading animation

shimmer_loading A Flutter project to show how to add shimmer loading animation.

null 0 Feb 6, 2022
Flutter package for creating awesome animations.

?? Simple Animations Simple Animations is a powerful package to create beautiful custom animations in no time. ?? fully tested ?? well documented ?? e

Felix Blaschke 879 Dec 31, 2022
A curated collection of awesome gradients made in Dart for Flutter

Flutter Gradients A curated collection of awesome gradients made in Dart (port of https://webgradients.com for Flutter). Only linear gradients include

Jonathan Monga 178 Dec 18, 2022
A Flutter package with a selection of simple yet very customizable set of loading animations.

Flutter Loading Animations A simple yet very customizable set of loading animations for Flutter projects. Installation Add the following to your pubsp

Andre Cytryn 171 Sep 23, 2022
Android loading animations

Android-SpinKit Android loading animations(I wrote a android edition according SpinKit) Demo Apk Preview Gradle Dependency dependencies { implement

ybq 8.4k Dec 30, 2022
Delightful, performance-focused pure css loading animations.

Loaders.css Delightful and performance-focused pure css loading animations. What is this? See the demo A collection of loading animations written enti

Connor Atherton 10.2k Jan 2, 2023
✨ A collection of loading indicators animated with flutter. Heavily Inspired by http://tobiasahlin.com/spinkit.

✨ Flutter Spinkit A collection of loading indicators animated with flutter. Heavily inspired by @tobiasahlin's SpinKit. ?? Installing dependencies:

Jeremiah Ogbomo 2.7k Dec 30, 2022
A collection of loading indicators animated with CSS

SpinKit Simple loading spinners animated with CSS. See demo. SpinKit only uses (transform and opacity) CSS animations to create smooth and easily cust

Tobias Ahlin 19k Dec 26, 2022
A new Flutter dialog with a series of beautiful animations, slide fade rotate size scale rotate3D animations.

flutter_animated_dialog A new Flutter dialog with a series of beautiful animations, slide fade rotate size scale rotate3D animations. Dialog barrier i

null 20 Dec 3, 2022
Create powerful animations in Flutter and use the hero animation for complex animations

Hero Animation - Locations UI - Flutter Create powerful animations in Flutter and use the hero animation for complex animations. ⚡  Social Media  Twit

null 3 Dec 11, 2021
A collection of Animations that aims to improve the user experience for your next flutter project.

A collection of Animations that aims to improve the user experience for your next flutter project.

Ezaldeen Sahb 134 Dec 24, 2022
🚅Flutter out-of-the-box collection animations written in pure dart.

LoadingIndicator A collection of out of the box loading animations written in pure dart, no extra dependency, inspired by loaders.css and NVActivityIn

Tino 170 Jan 1, 2023
An awesome list that curates the best Flutter libraries, tools, tutorials, articles and more.

Flutter is Google’s UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase. If you appr

Robert Felker 44.6k Dec 30, 2022
Loading Animation With Flutter

Flutter Loading Animation loading.ista.mp4 A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few re

Join Flutter 17 Oct 13, 2022
Lazy Loading Flutter Plugin

flutter_placeholder_textlines A simple plugin to generate placeholder lines that emulates text in a UI, useful for displaying placeholder content whil

Victor HG 21 Apr 12, 2022
✨A clean and lightweight loading/toast widget for Flutter, easy to use without context, support iOS、Android and Web

Flutter EasyLoading English | 简体中文 Live Preview ?? https://nslog11.github.io/flutter_easyloading Installing Add this to your package's pubspec.yaml fi

nslog11 1k Jan 9, 2023
Help you to build pull-down refresh and pull-up loading in the simplest way.

frefresh Help you to build pull-down refresh and pull-up loading in the simplest way. Although unprecedented simplicity, but the effect is amazing. It

Fliggy Mobile 427 Nov 26, 2022
A Flutter library for loading skeletons

TODO: Put a short description of the package here that helps potential users know whether this package might be useful for them. Features TODO: List w

Daniel 0 Jan 6, 2022