Description
lcProgressHUD is a lightweight and customizable progress HUD library for iOS. It provides a simple and intuitive way to display loading indicators and progress bars.
Installation
- Open your Xcode project.
- Go to “File” in the menu bar, then select “Swift Packages” and click on “Add Package Dependency”.
- Enter the URL of this repository: https://github.com/example/repo
- Select the desired version or branch.
- Click “Next” and then “Finish”.
Usage
To get started with lcProgressHUD, follow these steps:
- Import the library into your Swift file:
“`swift
import lcProgressHUD
“`
- Create an instance of lcProgressHUD:
“`swift
let progressHUD = lcProgressHUD()
“`
- Display the progress HUD:
“`swift
progressHUD.show()
“`
- Dismiss the progress HUD when you’re finished:
“`swift
progressHUD.dismiss()
“`
Customization
lcProgressHUD allows you to customize various aspects of the progress HUD. Here are some examples:
- Change the background color:
“`swift
progressHUD.backgroundColor = .black
“`
- Change the text color:
“`swift
progressHUD.textColor = .white
“`
- Change the loading indicator style:
“`swift
progressHUD.loadingIndicatorStyle = .circle
“`
- Customize the progress bar:
“`swift
progressHUD.progressBarColor = .blue
progressHUD.progressBarThickness = 5.0
“`
- Set a custom image:
“`swift
progressHUD.customImage = UIImage(named: “checkmark”)
“`
- Change the font:
“`swift
progressHUD.font = UIFont.systemFont(ofSize: 20)
“`
- Set a custom duration for auto-dismiss:
“`swift
progressHUD.autoDismissDuration = 3.0
“`
Completion Handler
lcProgressHUD provides a completion handler that you can use to perform additional tasks once the progress HUD is dismissed. Here’s how to use it:
“`swift
progressHUD.show(completion: {
// Code to execute once the progress HUD is dismissed
})
“`
Documentation
For detailed usage instructions and more information, please refer to the lcProgressHUD GitHub repository.