Description
HTProgressHUD is a clean and easy-to-use HUD (Head-Up Display) that can be used to show the progress of an ongoing task on iOS apps. It provides a simple and customizable way to display an overlay over the app’s current view during long-running tasks, such as network requests or data processing. HTProgressHUD is designed to give users visual feedback on the progress and keep them informed about the ongoing operation.
Features
- Elegant and unobtrusive HUD display
- Customizable appearance and animation
- Supports different types of progress indicators (e.g., spinner, text, image, etc.)
- Optional progress text to show task-related information
- Flexible and easy-to-use API
Installation
To integrate HTProgressHUD into your project, follow these steps:
- Install HTProgressHUD via Cocoapods by adding the following line to your Podfile:
pod 'HTProgressHUD'
Then run the command:
pod install
- Import HTProgressHUD into your project:
import HTProgressHUD
Usage
Using HTProgressHUD is straightforward. Follow the example code below to get started:
// Create an instance of HTProgressHUD
let progressHUD = HTProgressHUD(style: .light)
// Show the progress HUD
progressHUD.show()
// Perform your long-running task here
// Hide the progress HUD
progressHUD.hide()
Customization
HTProgressHUD provides various customization options to tailor the appearance and behavior of the HUD. Below are some commonly used customization properties and methods:
progressHUD.font
: Set the font for the progress textprogressHUD.textColor
: Set the color of the progress textprogressHUD.spinnerColor
: Set the color of the spinnerprogressHUD.backgroundColor
: Set the background color of the HUDprogressHUD.cornerRadius
: Set the corner radius of the HUDprogressHUD.showCompletion
: Set a completion block to execute after the HUD is displayedprogressHUD.hideCompletion
: Set a completion block to execute after the HUD is hidden
Acknowledgements
HTProgressHUD was inspired by and utilizes code from the SVProgressHUD library. Many thanks to the SVProgressHUD contributors for their excellent work.