Lightweight Progress HUD implementation for iOS.
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> | ![]() |
![]() |
To run the example project, clone the repo, and run pod install
from the Example directory beforehand.
DLProgressHUD requires iOS 13.0 and Swift 5.0 or above. For iOS 12 support you can use 0.1.12 pod version.
DLProgressHUD is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'DLProgressHUD'
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)
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 |
There are two ways to configure the appearance and presentation of DLProgressHUD
:
DefaultHudConfiguration
class before instantiation.DLProgressHUD.defaultConfiguration.backgroundInteractionEnabled = true
DLProgressHUD.show(.loading)
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)
DeluxeAlonso, [email protected]
DLProgressHUD is available under the MIT license. See the LICENSE file for more info.
link |
Stars: 3 |
Last commit: 4 weeks ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics