Skip to content

A clean and lightweight progress HUD for your iOS app.

License

Notifications You must be signed in to change notification settings

immortal-it/IMProgressHUD

Repository files navigation

IMProgressHUD

Pod Version Pod Platform Pod License CocoaPods compatible Carthage Compatible

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

Requirements

  • iOS 11.0+
  • Xcode 11+
  • Swift 5.0+

Installation

From CocoaPods

CocoaPods is a dependency manager for Cocoa projects, which automates and simplifies the process of using 3rd-party libraries like IMProgressHUD in your projects. First, add the following line to your Podfile:

pod 'IMProgressHUD'

If you want to use the latest features of IMProgressHUD use normal external source dependencies.

pod 'IMProgressHUD', :git => 'https://github.com/immortal-it/IMProgressHUD.git'

This pulls from the main branch directly.

Second, install IMProgressHUD into your project:

pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate IMProgressHUD into your Xcode project using Carthage, specify it in your Cartfile:

github "immortal-it/IMProgressHUD" ~> 1.0.0

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. It is in early development, but IMProgressHUD does support its use on supported platforms.

Once you have your Swift package set up, adding IMProgressHUD as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "https://github.com/immortal-it/IMProgressHUD", .upToNextMajor(from: "1.0.0"))
]

Manually

  • Drag the immortal-it/IMProgressHUD folder into your project.

Usage

(see sample Xcode project in Demo)

IMProgressHUD is created as a singleton.

Use IMProgressHUD 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.

Using IMProgressHUD in your app will usually look as simple as this (using Grand Central Dispatch):

IMProgressHUD.show()
DispatchQueue.global().async {
  DispatchQueue.main.async {
    IMProgressHUD.hide()
  }
}

Showing the HUD

  • Showing the Toast

showToast(_ message: String)
showToast(message: String, location: Location) -> IMProgressHUD
  • Showing the Status

show(message: String? = nil, image: UIImage? = nil)
showSuccess(_ message: String? = nil)
showFail(_ message: String? = nil)
  • Showing the Progress Indicator

showProgress(_ progress: CGFloat, indicatorType: ProgressIndicatorType = .default, message: String? = nil)

Dismissing the HUD

The HUD can be dismissed using:

hide()
hideAfterDelay(_ delay: TimeInterval)

Customization

IMProgressHUD can be customized via the Configuration:

License

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

About

A clean and lightweight progress HUD for your iOS app.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages