The JGProgressHUD library is a lightweight and easy-to-use progress HUD (heads-up display) for iOS applications, written in Objective-C.
Purpose
The primary purpose of the JGProgressHUD library is to provide an intuitive and customizable progress HUD that can be used to indicate the progress of long-running tasks or to display simple alerts and messages to users.
Key Features
- Simple and easy to integrate into your iOS app
- Provides customizable loading spinners and progress bars
- Supports displaying text messages and subtitles
- Offers various built-in animation styles for smooth transitions
- Allows customization of appearance, such as background color and text color
- Supports multi-tasking and concurrent progress HUDs
Installation
To install JGProgressHUD in your iOS project, follow these steps:
- Open your project in Xcode.
- Navigate to your project’s directory, then open the
.xcworkspace
file. - Add the JGProgressHUD library to your project by either:
Using CocoaPods
If you are using CocoaPods for dependency management:
# Podfile
target 'YourApp' do
pod 'JGProgressHUD'
end
Using Carthage
If you are using Carthage for dependency management:
github "JonasGessner/JGProgressHUD"
Run pod install
or carthage update
to install the JGProgressHUD library and integrate it into your project.
Usage
To use JGProgressHUD in your iOS app:
- Import the JGProgressHUD class into your view controller:
import JGProgressHUD
- Create an instance of JGProgressHUD:
let progressHUD = JGProgressHUD(style: .light)
- Configure the desired properties of the progressHUD, such as the animation type, text color, or background color:
progressHUD.animationType = .fadeIn
progressHUD.textLabel.text = "Loading"
progressHUD.indicatorView = JGProgressHUDIndeterminateIndicatorView()
progressHUD.backgroundColor = .white
- Show the progressHUD:
progressHUD.show(in: self.view)
- Dismiss the progressHUD when the task completes:
progressHUD.dismiss()
Customization
JGProgressHUD offers extensive customization options. Some of the available properties that you can customize include:
- Animation style
- Indicator view
- Text color
- Background color
- Font
- Corner radius
- Minimum display time
To explore customization further, refer to the official documentation for a detailed overview of available options.
Additional Resources
For more information and examples of usage, refer to the official JGProgressHUD documentation.