Introduction
The JDFNavigationBarActivityIndicatorView is a custom activity indicator view for iOS applications. It provides a simple and customizable way to display an activity indicator in a navigation bar.
Features
- Customizable appearance
- Supports both light and dark mode
- Automatic layout adjustment for navigation bar changes
- Easy integration with standard iOS navigation controllers
Installation
To integrate JDFNavigationBarActivityIndicatorView into your project, you can use CocoaPods or manually add the source files.
CocoaPods
Add the following line to your Podfile:
pod 'JDFNavigationBarActivityIndicatorView'
Manual Installation
- Download the latest release from the GitHub repository.
- Drag and drop the JDFNavigationBarActivityIndicatorView.swift file into your project.
- Make sure to check the “Copy items if needed” checkbox.
- Import the JDFNavigationBarActivityIndicatorView module in your source file.
Usage
To use JDFNavigationBarActivityIndicatorView, follow the steps below:
Step 1: Import the module
Add the following import statement to your code:
import JDFNavigationBarActivityIndicatorView
Step 2: Create an instance
Create an instance of JDFNavigationBarActivityIndicatorView in your view controller or where you want to display the activity indicator:
let activityIndicator = JDFNavigationBarActivityIndicatorView()
Step 3: Customize appearance (optional)
You can customize the appearance of the activity indicator by adjusting its properties. For example:
activityIndicator.color = UIColor.red
activityIndicator.lineWidth = 3.0
Step 4: Show/hide the activity indicator
To show the activity indicator in the navigation bar, call the willShowActivityIndicator()
method:
activityIndicator.willShowActivityIndicator()
To hide the activity indicator, call the willHideActivityIndicator()
method:
activityIndicator.willHideActivityIndicator()
Other Information
- GitHub Repository: https://github.com/jamesfdempsey/JDFNavigationBarActivityIndicatorView
- License: MIT License
Conclusion
With JDFNavigationBarActivityIndicatorView, you can easily add a custom activity indicator to your navigation bar with customizable appearance and automatic layout adjustments. It simplifies the process of displaying and hiding activity indicators in your iOS applications.