• Stars
    star
    206
  • Rank 184,222 (Top 4 %)
  • Language
    Swift
  • Created over 3 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A collection of lightweight SwiftUI loading animations.

SwiftfulLoadingIndicators

A collection of lightweight loading animations that can be applied to any SwiftUI view with 1 line of code. All animations are built using the SwiftUI framework (and in a few cases, the Combine framework).

👍 20+ animations!

🎨 Works with any Color

🧰 Customize speed & size

No keyframe animations or DispatchQueue calls that could negatively affect the UI

Source files have no depencendies and can be extracted without issue

Imgur

Imgur Imgur

Installation

Swift Package Manager

The Swift Package Manager is a tool for managing the distribution of Swift code. To use SwiftfulLoadingIndicators with Swift Package Manager in an Xcode project:

Usage

Firstly, import the package to your file.

import SwiftfulLoadingIndicators

Then add a LoadingIndicator to your SwiftUI view.

LoadingIndicator()

The indicators are customizable in terms of animation, color, size, and speed. All parameters are optional and will init with default values if not included. Example implementations:

// DEFAULT PARAMETERS:
// Animation == .threeBalls
// Color == .primary
// Size == .medium
// Speed == .normal
LoadingIndicator()
LoadingIndicator(animation: .fiveLines)
LoadingIndicator(animation: .fiveLines, color: .red)
LoadingIndicator(animation: .fiveLines, color: .red, size: .large)
LoadingIndicator(animation: .fiveLines, color: .red, size: .large, speed: .fast)
LoadingIndicator(color: .red)
LoadingIndicator(size: .large)
LoadingIndicator(speed: .slow)

The indicators will animate as soon as they appear on the screen, similar to the native ProgressView(). Recommended approach is to add the indicator to the View only when it is required:

if isLoading {
    LoadingIndicator()
}

To quickly see all animation options, simply add a LoadingShowcaseView.

LoadingShowcaseView()

To quickly see all size and speed options for a single animation, simply add a LoadingPreviewView.

LoadingPreviewView(animation: .threeBalls)

Additional Configuration & Notes

All loading indicators are built for SwiftUI. The majority of animations are triggered by toggling a very simple @State variable when they appear. A few of the more complex animations use a Publisher through the Combine framework.

The animations are meant to be highly customizable and each animation file does not have any external dependencies. If you would prefer to (1) customize one of the animations or (2) only include one of the animations in your project, you can simple copy + paste the source file directly.

  • path: SwiftfulLoadingIndicators/Sources/SwiftfulLoadingIndicators/Animations/

Supported Platforms:

  • .macOS(.v11)
  • .iOS(.v13)
  • .tvOS(.v14)
  • .watchOS(.v7)

More Repositories

1

SwiftfulRouting

Programmatic navigation for SwiftUI applications.
Swift
261
star
2

SwiftfulUI

A collection of reusable SwiftUI components.
Swift
240
star
3

SwiftUI-Bootcamp

Full source code for the SwiftUI Bootcamp. The complete tutorial is available for free on my YouTube channel @SwiftfulThinking. The project is a collection of individual tutorials and not a working application.
Swift
155
star
4

SwiftUI-Crypto-MVVM-CoreData-Combine

Full source code for the SwiftUI Crypto App. The complete tutorial is available for free on my YouTube channel @SwiftfulThinking. The project uses MVVM Architecture, CoreData and Combine. Live cryptocurrency data is downloaded from CoinGecko API.
Swift
110
star
5

SwiftUI-Advanced-Learning

Full source code for the SwiftUI Advanced Learning Bootcamp. The complete tutorial is available for free on my YouTube channel @SwiftfulThinking. The project is a collection of individual tutorials and not a working application.
Swift
74
star
6

SwiftUI-Todo-List-MVVM-UserDefaults

Full source code for the SwiftUI Todo List. The complete tutorial is available for free on my YouTube channel @SwiftfulThinking. The project uses MVVM architecture and UserDefaults to persist data.
Swift
57
star
7

SwiftUI-Continued-Learning

Full source code for the SwiftUI Continued Learning course. The complete tutorial is available for free on my YouTube channel @SwiftfulThinking. The project is a collection of individual tutorials and not a working application.
Swift
55
star
8

Firebase-SwiftUI-Bootcamp

Full source code for the SwiftUI Firebase Bootcamp. The complete tutorial is available for free on my YouTube channel @SwiftfulThinking. The project is a collection of individual tutorials and not a working application.
Swift
41
star
9

Swift-Concurrency-Bootcamp

Full source code for the Swift Concurrency Bootcamp. The complete tutorial is available for free on my YouTube channel @SwiftfulThinking. The project is a collection of individual tutorials and not a working application.
Swift
40
star
10

SwiftfulRoutingExample

Sample project for SwiftfulRouting framework.
Swift
31
star
11

SwiftfUI-Map-App-MVVM

Full source code for the SwiftUI Map App. The complete tutorial is available for free on my YouTube channel @SwiftfulThinking. The project uses MVVM architecture and MapKit.
Swift
31
star
12

SwiftfulFirebaseAuth

Firebase Authentication for Swift projects.
Swift
27
star
13

SwiftfulThinking

Let's connect!
26
star
14

Swift-Basics

Full source code for the Swift Basics Bootcamp. The complete tutorial is available for free on my YouTube channel @SwiftfulThinking. The project is a collection of individual tutorials and not a working application.
Swift
22
star
15

SwiftfulSaving

Native data persistence for iOS applications.
Swift
18
star
16

DreamCacher

A lightweight framework for local caching via the FileManager.
Swift
14
star
17

SwiftfulSavingExample

Sample project for SwiftfulSaving framework.
Swift
12
star
18

SwiftfulFirestore

Convenience functions for using Firebase Firestore with Swift Concurrency (async/await).
Swift
11
star
19

SwiftfulSourceControl

Swift
4
star
20

SwiftfulRecursiveUI

Recursive SwiftUI View
Swift
3
star