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
🔍 Awesome fully customize search view like Pinterest written in Swift 5.0 + Realm support!

YNSearch + Realm Support Updates See CHANGELOG for details Intoduction ?? Awesome search view, written in Swift 5.0, appears search view like Pinteres

Kyle Yi 1.2k Dec 17, 2022
A number of preset loading indicators created with SwiftUI

ActivityIndicatorView A number of preset loading indicators created with SwiftUI We are a development agency building phenomenal apps. Usage Create an

Exyte 956 Dec 26, 2022
Play BreakOut while loading - A playable pull to refresh view using SpriteKit

BreakOutToRefresh Play BreakOut while loading - A playable pull to refresh view using SpriteKit BreakOutToRefresh uses SpriteKit to add a playable min

Dominik Hauser 2.5k Jan 5, 2023
Beautiful animated placeholders for showing loading of data

KALoader Create breautiful animated placeholders for showing loading of data. You can change colors like you want. Swift 4 compatible. Usage To add an

Kirill Avery 105 May 2, 2022
An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.

LoadingShimmer An easy way to add a shimmering effect to any view with just single line of code. It is useful as an unobtrusive loading indicator. Thi

Jogendra 1.4k Jan 4, 2023
Placeholder views based on content, loading, error or empty states

StatefulViewController A protocol to enable UIViewControllers or UIViews to present placeholder views based on content, loading, error or empty states

Alexander Schuch 2.1k Dec 8, 2022
Windless makes it easy to implement invisible layout loading view.

Windless Windless makes it easy to implement invisible layout loading view. Contents Requirements Installation Usage Looks Credits Communication Licen

ArLupin 940 Dec 22, 2022
A drop-in universal library helps you to manage the navigation bar styles and makes transition animations smooth between different navigation bar styles

A drop-in universal library helps you to manage the navigation bar styles and makes transition animations smooth between different navigation bar styles while pushing or popping a view controller for all orientations. And you don't need to write any line of code for it, it all happens automatically.

Zhouqi Mo 3.3k Dec 21, 2022
💾 A collection of classic-style UI components for iOS

A collection of classic-style UI components for UIKit, influenced by Windows 95 Introduction This is a little exploration into applying '90s-era desig

Blake Tsuzaki 2.2k Dec 22, 2022
xTensions is a collection of useful class extensions for UIKit.

xTensions Intro xTensions is a collection of useful class extensions for UIKit. Swift Package Manager Note: Instructions below are for using SwiftPM w

Alexandre Garrefa 0 Nov 28, 2021
NVActivityIndicatorView is a collection of awesome loading animations.

NVActivityIndicatorView is a collection of awesome loading animations.

Vinh Nguyen 10.3k Jan 5, 2023
Awesome loading animations using 3D engine written with Swift

RSLoadingView Introduction RSLoadingView bring your app to the new age of loading animations using 3D engine. Written with Swift Customizable Using Ap

null 419 Dec 16, 2022
A Swift library to take the power of UIView.animateWithDuration(_:, animations:...) to a whole new level - layers, springs, chain-able animations and mixing view and layer animations together!

ver 2.0 NB! Breaking changes in 2.0 - due to a lot of requests EasyAnimation does NOT automatically install itself when imported. You need to enable i

Marin Todorov 3k Dec 27, 2022
A collection of animations for iOS. Simple, just add water animations.

DCAnimationKit A collection of animations for iOS Simply, just add water! DCAnimationKit is a category on UIView to make animations easy to perform. E

Dalton 797 Sep 23, 2022
A lightweight and awesome loading Activity Indicator for your iOS app.

BPCircleActivityIndicator BPCircleActivityIndicator is a clean and easy-to-use Activity Indicator meant to display the progress of an ongoing task on

Ben.Park 46 Aug 12, 2022
A simple and awesome loading Activity Indicator(with block moving animation) for your iOS app.

BPBlockActivityIndicator BPBlockActivityIndicator is a clean and easy-to-use Activity Indicator meant to display the progress of an ongoing task on iO

Ben.Park 43 Nov 6, 2021
A SwiftUI view for dynamically rendering content based upon "loading", "error", and "completed" data loading states.

SwiftUIAsyncContentView A SwiftUI view for dynamically rendering content based upon "loading", "error", and "completed" data loading states.. Installa

CypherPoet 0 Dec 26, 2021
☠️SkeletonUI aims to bring an elegant, declarative syntax to skeleton loading animations.

SkeletonUI aims to bring an elegant, declarative syntax to skeleton loading animations. Get rid of loading screens or spinners and start using skeletons to represent final content shapes.

Carlos Solana Martínez 551 Dec 18, 2022
💀 An easy way to create sliding CAGradientLayer animations! Works great for creating skeleton screens for loading content.

Skeleton is an easy way to create sliding CAGradientLayer animations! It works great for creating skeleton screens: ??‍?? Usage The entire library com

Gonzalo Nuñez 668 Nov 2, 2022