Swiftpack.co - DeluxeAlonso/DLProgressHUD as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by DeluxeAlonso.
DeluxeAlonso/DLProgressHUD 0.1.12
Lightweight Progress HUD implementation for iOS.
⭐️ 1
🕓 1 week ago
iOS
.package(url: "https://github.com/DeluxeAlonso/DLProgressHUD.git", from: "0.1.12")

DLProgressHUD

CI Status Version License Platform

Lightweight Progress HUD implementation for iOS.

Demo

Loading Loading with text Text only Image Image with text
<img style="max-width:100%;" src="Scsrc="https://raw.github.com/DeluxeAlonso/DLProgressHUD/main/hots/TextOnly.png" width=200 height=100>

Example project

To run the example project, clone the repo, and run pod install from the Example directory beforehand.

Requirements

DLProgressHUD requires iOS 12.0 and Swift 5.0 or above.

Installation

DLProgressHUD is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'DLProgressHUD'

Usage

There are five modes that can be used to show the progress HUD: loading, loadingWithText, textOnly, image and imageWithText.

You just need to call the show method and pass the HUD mode as a parameter:

DLProgressHUD.show(.loading)

Available HUD modes

Mode Description
loading HUD with an activity indicator only
loadingWithText(_ text: String) HUD with an activity indicator and a text label below it
textOnly(_ text: String) HUD with a text label only
image(_ image: UIImage) HUD with an image view only
imageWithText(image: UIImage, text: String) HUD with an image view and a text label below it

Appearance and presentation configuration

There are two ways to configure the appearance and presentation of DLProgressHUD:

  1. You can do it globally using the DefaultHudConfiguration class before instantiation.
DLProgressHUD.defaultConfiguration.backgroundInteractionEnabled = true
DLProgressHUD.show(.loading)
  1. You can create your own configuration instance that conforms to HudConfigurationProtocol protocol and pass it on DLProgressHUD's methods.
struct HudCustomConfiguration: HudConfigurationProtocol {
    var hudContentPreferredHeight: CGFloat = 64
    var hudContentPreferredWidth: CGFloat = 180
    var textFont: UIFont = .systemFont(ofSize: 18.0)
}
let configuration = HudCustomConfiguration()
DLProgressHUD.show(.textOnly("Loading..."), configuration: configuration)

Author

DeluxeAlonso, alonso.alvarez.dev@gmail.com

License

DLProgressHUD is available under the MIT license. See the LICENSE file for more info.

GitHub

link
Stars: 1
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics