## Introduction
Welcome to the documentation for the `MOLoaderView` framework! This framework provides a customizable loader view for your iOS applications. With `MOLoaderView`, you can enhance the user experience by displaying a loading indicator while data is being fetched or processed.
## Installation
To add `MOLoaderView` to your Xcode project, you have a few options. Choose one of the following methods:
### CocoaPods
You can install `MOLoaderView` through CocoaPods. Simply add the following line to your `Podfile`:
“`ruby
pod ‘MOLoaderView’
“`
Then, run `pod install` command in your project directory to install the framework.
### Manual Installation
If you prefer manual installation, follow the steps below:
1. Download the latest version of `MOLoaderView` from the official GitHub repository: [https://github.com/yourusername/MOLoaderView](https://github.com/yourusername/MOLoaderView)
2. Extract the downloaded ZIP file.
3. In Xcode, open your project workspace.
4. Drag and drop the `MOLoaderView.xcodeproj` file into your Xcode project’s `Frameworks` group.
5. Select your project target, go to the `General` tab, and scroll down to `Frameworks, Libraries, and Embedded Content`.
6. Click the `+` button and select `MOLoaderView.framework`.
7. Make sure to set the `Embed` option to `Embed & Sign`.
## Usage
### Importing the Framework
To begin using `MOLoaderView`, you need to import the framework in your view controller:
“`swift
import MOLoaderView
“`
### Adding MOLoaderView to your View
You can add `MOLoaderView` as a subview to any of your existing views. Follow the steps below to do so:
1. Create an instance of `MOLoaderView`:
“`swift
let loaderView = MOLoaderView()
“`
2. Customize the appearance and behavior of the loader view using the available properties and methods:
“`swift
loaderView.backgroundColor = .white
loaderView.cornerRadius = 8.0
loaderView.indicatorStyle = .medium
“`
3. Add the `MOLoaderView` to your desired view:
“`swift
self.view.addSubview(loaderView)
“`
### Displaying and Hiding the Loader
To show the loader view, call the `showLoader()` method:
“`swift
loaderView.showLoader()
“`
To hide the loader view, call the `hideLoader()` method:
“`swift
loaderView.hideLoader()
“`
## Properties
### backgroundColor: UIColor
The color of the loader view’s background. You can set any valid `UIColor` value.
**Example:**
“`swift
loaderView.backgroundColor = UIColor.white
“`
### cornerRadius: CGFloat
The corner radius for the loader view. You can set any positive `CGFloat` value to achieve rounded corners.
**Example:**
“`swift
loaderView.cornerRadius = 8.0
“`
### indicatorStyle: UIActivityIndicatorView.Style
The style of the activity indicator. You can choose from the following styles:
– `.large`: a large activity indicator.
– `.medium`: a medium-sized activity indicator.
– `.small`: a small activity indicator.
**Example:**
“`swift
loaderView.indicatorStyle = .medium
“`
## Methods
### showLoader()
Displays the loader view on top of the current view.
**Example:**
“`swift
loaderView.showLoader()
“`
### hideLoader()
Hides the loader view and removes it from the view hierarchy.
**Example:**
“`swift
loaderView.hideLoader()
“`
## Conclusion
You have now learned how to integrate and use the `MOLoaderView` framework in your iOS application. Take advantage of this customizable loader view to enhance the user experience during data loading or processing tasks. Happy coding!