TTProgressHUD is a light weight HUD written in SwiftUI meant to display the progress of an ongoing task on iOS.

Overview

TTProgressHUD

TTProgressHUD is a light weight HUD written in SwiftUI meant to display the progress of an ongoing task on iOS. TTProgressHUD (left) was designed to look as similar as possible to the Apple HUD (example from Podcast.app, right).

Installation

Xcode 11 and iOS 13 is required.

Swift Package Manager

Manually

Drag TTProgressHUD.swift and TTProgressHUDConfig.swift into your project.

Usage

Use TTProgressHUD wisely! Only use it if you absolutely need to perform a task before taking the user forward. Bad use case examples: pull to refresh, infinite scrolling, sending message.

Import

Import the TTProgressHUD package:

import TTProgressHUD

Instantiate and show the HUD view

struct ContentView: View {
    @State var hudVisible = true
    @State var hudConfig = TTProgressHUDConfig()
    
    var body: some View {
        TTProgressHUD($hudVisible, config: hudConfig)
    }
}

Customization

TTProgressHUD can be customized via the TTProgressHUDConfig struct. The default values were chosen so that TTProgressHUD looks as similar as possible to the Apple HUD.

public init(
    type: TTProgressHUDType         = .loading,
    title: String?                  = nil,
    caption: String?                = nil,
    minSize: CGSize                 = CGSize(width: 100.0, height: 100.0),
    cornerRadius: CGFloat           = 12.0,
    backgroundColor: Color          = .clear,
    titleForegroundColor: Color     = .primary,
    captionForegroundColor: Color   = .secondary,
    shadowColor: Color              = .clear,
    shadowRadius: CGFloat           = 0.0,
    borderColor: Color              = .clear,
    borderWidth: CGFloat            = 0.0,
    lineWidth: CGFloat              = 10.0,
    imageViewSize: CGSize           = CGSize(width: 100, height: 100),
    imageViewForegroundColor: Color = .primary,
    successImage: String            = "checkmark.circle",
    warningImage: String            = "exclamationmark.circle",
    errorImage: String              = "xmark.circle",
    shouldAutoHide: Bool            = false,
    allowsTapToHide: Bool           = false,
    autoHideInterval: TimeInterval  = 10.0,
    hapticsEnabled: Bool            = true
){...}

Haptic Feedback

TTProgressHUD will automatically trigger haptic feedback depending on which HUD is being displayed. The feedback maps as follows:

  • TTProgressHUDType.success <-> UINotificationFeedbackTypeSuccess
  • TTProgressHUDType.warning <-> UINotificationFeedbackTypeWarning
  • TTProgressHUDType.error <-> UINotificationFeedbackTypeError

Contributing to this project

If you have feature requests or bug reports, feel free to help out by sending pull requests or by creating new issues. Please take a moment to review the guidelines written by Nicolas Gallagher:

License

TTProgressHUD is distributed under the terms and conditions of the MIT license.

Credits

TTProgressHUD is brought to you by Tobias Tiemerding and based on SVProgressHUD. If you're using TTProgressHUD in your project, attribution would be very appreciated.

You might also like...
Light weight tool for detecting the current device and screen size written in swift.
Light weight tool for detecting the current device and screen size written in swift.

Device detect the current  device model and screen size. Installation CocoaPods Device is available through CocoaPods. To install it, simply add the

Light weight tool for detecting the current device and screen size written in swift.
Light weight tool for detecting the current device and screen size written in swift.

Device detect the current  device model and screen size. Installation CocoaPods Device is available through CocoaPods. To install it, simply add the

A light-weight server-side service framework written in the Swift programming language.

Smoke Framework The Smoke Framework is a light-weight server-side service framework written in Swift and using SwiftNIO for its networking layer by de

Simple and light weight facebook login library for UIKit & SwiftUI
Simple and light weight facebook login library for UIKit & SwiftUI

MjFbLogin Simple and light weight facebook login library which provides support for UIKit & SwiftUI Example To run the example project, clone the repo

An ongoing curated list of frameworks, books, articles, talks, screencasts, recordings, libraries, learning tutorials and resources about Swift
Rakning C-19 is an app that can be downloaded voluntarily and facilitates the contact tracing process amidst the ongoing Covid-19 pandemic in Iceland

Rakning C-19 App Rakning C-19 is an app that can be downloaded voluntarily and facilitates the contact tracing process amidst the ongoing Covid-19 pan

A beautiful and easy-to-use progress HUD for your iOS.
A beautiful and easy-to-use progress HUD for your iOS.

日本語 KRProgressHUD is a beautiful and easy-to-use progress HUD for your iOS written by Swift. KRActivityIndicatorView is used for loading view. Feature

An unintrusive & light-weight iOS app-theming library with support for animated theme switching.
An unintrusive & light-weight iOS app-theming library with support for animated theme switching.

Gestalt Gestalt is an unintrusive and light-weight framework for application theming with support for animated theme switching. Usage Let's say you wa

A light weight & simple & easy camera for iOS by Swift.
A light weight & simple & easy camera for iOS by Swift.

DKCamera Description A light weight & simple & easy camera for iOS by Swift. It uses CoreMotion framework to detect device orientation, so the screen-

A light-weight, extensible package for building pixel-perfect iOS settings screens.
A light-weight, extensible package for building pixel-perfect iOS settings screens.

SettingsKit A light-weight, extensible package for easily building pixel-perfect iOS settings screens in a pinch. Installation SettingsKit can be inst

Simple Swift Progress HUD

MKProgress An iOS Simple Swift Progress HUD Requirements iOS 9.0+ Swift 3.0+ Xcode 8.0+ Installation MKProgress is only available via CocoaPods: pod '

A clean and lightweight progress HUD based on SVProgressHUD, converted to Swift with the help of Swiftify.

IHProgressHUD IHProgressHUD is a clean and easy-to-use HUD meant to display the progress of an ongoing task on iOS and tvOS. IHProgressHUD is based on

Light-weight, operator-overloading-free complements to CoreGraphics!

Graphicz 🎨 Light-weight, operator-overloading-free complements to CoreGraphics! Even though I shipped it with my app, I still need to invest the time

FlightLayout is a light weight, and easy to learn layout framework as an extension of the UIView.
FlightLayout is a light weight, and easy to learn layout framework as an extension of the UIView.

FlightLayout Introduction FlightLayout is a light weight, and easy to learn layout framework as an extension of the UIView. Functionally, it lives som

A light weight network library with automated model parser for rapid development

Gem A light weight network library with automated model parser for rapid development. Managing all http request with automated model parser calls in a

A light-weight TDD / BDD framework for Objective-C & Cocoa
A light-weight TDD / BDD framework for Objective-C & Cocoa

Specta A light-weight TDD / BDD framework for Objective-C. FEATURES An Objective-C RSpec-like BDD DSL Quick and easy set up Built on top of XCTest Exc

Switchboard - easy and super light weight A/B testing for your mobile iPhone or android app. This mobile A/B testing framework allows you with minimal servers to run large amounts of mobile users.

Switchboard - easy A/B testing for your mobile app What it does Switchboard is a simple way to remote control your mobile application even after you'v

Simple and light weight slider with chapter management
Simple and light weight slider with chapter management

Simple and light weight slider with chapter management Demo Installation CocoaPods WESlider is available through CocoaPods. To install it, simply add

A light-weight UITextView subclass that automatically grows and shrinks.
A light-weight UITextView subclass that automatically grows and shrinks.

RSKGrowingTextView A light-weight UITextView subclass that automatically grows and shrinks based on the size of user input and can be constrained by m

Comments
  • Add Hashable conformance to TTProgressHUDConfig

    Add Hashable conformance to TTProgressHUDConfig

    It's always harder to add Equatable conformance to a type in another package, so I think its worth adding here. I needed it to include the config in my application state.

    opened by hartbit 6
  • Add foreground color in config to be able to change the background of progress view

    Add foreground color in config to be able to change the background of progress view

    We want to personalise the foreground color of the progress view, but it is hardcoded now. With this change you will be able to change the desired color.

    Thanks

    opened by pablogeek 3
  •  Showing All Messages Failed to resolve dependencies

    Showing All Messages Failed to resolve dependencies

    Xcode Version 11.7 (11E801a) SwiftUI project target iOS 13.0

    while add Swift Package Dependency, show error below:

    because every version of TTProgressHUD contains incompatible tools version and root depends on TTProgressHUD 0.0.2..<1.0.0, version solving failed.
    
    opened by donly 3
  • Title customization

    Title customization

    I really like this library, except for the text. Right now the font is a bit large and limited to 1 or 2 lines depending on the label, and I wish it had a bit more flexibility. A way to change the font size, or the line limit, or both. Is this something you would be interested in allowing as a configuration option?

    opened by Vortec4800 2
Releases(0.0.2)
Owner
Tobias Totzek
Senior iOS Engineer
Tobias Totzek
Snake Progress shows circular progress for iOS Apps.

SnakeProgress SnakeProgress shows circular progress for iOS Apps. With SnakeProgress With SnakeProgress, you can easily circular progress. @IBOutlet w

null 8 Sep 22, 2022
A Circular SwiftUI progress View

A Circular progress view. There are some controllers to let you customize the progress-view and see which one works better for you. This whole project

Mahdi Bahrami 8 May 7, 2022
AsyncView is a SwiftUI View for handling in-progress and error states when loading data asynchronously.

AsyncView AsyncView is a SwiftUI View for handling in-progress and error states when loading data asynchronously using async/await: See my blog post "

Ralf Ebert 41 Dec 20, 2022
A simple circular progress view for iOS

CircularProgress A simple circular progress view for iOS. TODOs Gradient Colors Shadow Paths & Colors Multiplied Progress (i.e. progress > 1.0) Usage

i_82 10 Nov 11, 2022
I couldn't find a progress bar package, so I created one

swiftbar I couldn't find a progress bar package, so I created one. Installation This package is available via the Swift Package Manager. Simply add .p

null 0 Dec 6, 2021
Circular progress view for Titanium

ti.circularprogress Circular progress view for Titanium. Using https://github.com/kaandedeoglu/KDCircularProgress (iOS) and https://github.com/owl-93/

null 12 Oct 2, 2022
Easily show HUDs with SwiftUI! Lightweight SwiftUI wrapper for JGProgressHUD for iOS, tvOS, Catalyst.

JGProgressHUD-SwiftUI This is a lightweight and easy-to-use SwiftUI wrapper for JGProgressHUD, giving you access to the large and proven feature set o

Jonas Gessner 78 Dec 21, 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
GaugeProgressViewStyle adds the Apple Watch gauge view to iOS.

GaugeProgressViewStyle adds the Apple Watch gauge view to iOS. Installation To install GaugeProgressViewStyle, add GaugeProgressViewStyle as a depende

null 29 Jul 28, 2022
Light weight charts view generater for iOS. Written in Swift.

# ###Light weight charts view generater for iOS. Written in Swift. Requirements iOS 8.0+ XCode 7.3+ Installation CocoaPods $ pod init specify it in yo

Recruit Holdings. Media Technology Lab 982 Nov 16, 2022