Welcome to the documentation for the AlamofireNetworkActivityIndicator CocoaPod. This library provides a convenient way to manage the network activity indicator on iOS applications built with the Alamofire networking library.
Installation
To install AlamofireNetworkActivityIndicator, follow these steps:
- Open your terminal.
- Navigate to your project directory.
- Run the following command to install the library:
pod 'AlamofireNetworkActivityIndicator'
Integration
After installing the pod, you need to integrate AlamofireNetworkActivityIndicator into your project.
- First, open your project in Xcode.
- Navigate to your AppDelegate.swift file.
- Add the following import statement at the top of the file:
import AlamofireNetworkActivityIndicator
- In the AppDelegate class, add the following line of code inside the
didFinishLaunchingWithOptions
method:
// Enable network activity indicator
NetworkActivityIndicatorManager.shared.isEnabled = true
Usage
To use the AlamofireNetworkActivityIndicator library:
- Import the library in your relevant view controller:
import AlamofireNetworkActivityIndicator
- Make sure Alamofire is integrated into your project.
- When making network requests using Alamofire, the network activity indicator will automatically appear in the status bar.
Conclusion
AlamofireNetworkActivityIndicator offers an effortless way to display the network activity indicator while using the Alamofire networking library in your iOS application. By following the installation and integration steps outlined in this documentation, you will be able to utilize this library and enhance the user experience of your app.
Thank you for choosing AlamofireNetworkActivityIndicator!