Welcome to the documentation page for the AA MaterialSpinner library. In this guide, we will explore the various features and functionalities of this library, as well as provide instructions on how to implement it in your iOS application.


To use AA MaterialSpinner in your project, you can install it via CocoaPods. Add the following line to your Podfile:

// Podfile
pod 'AAMaterialSpinner'

After updating the Podfile, run the command pod install in Terminal to install the library and integrate it into your Xcode workspace.


To start using AA MaterialSpinner in your project, import it into your Swift file:

import AAMaterialSpinner

Once imported, you can create an instance of the spinner:

let spinner = AAMaterialSpinner(frame: CGRect(x: 0, y: 0, width: 50, height: 50))

Customize the appearance of the spinner by modifying its properties, such as color:

spinner.spinnerColor = .red

Add the spinner to your view hierarchy:


To start animating the spinner, call the startAnimating() method:


If you want to stop the animation, use the stopAnimating() method:



The AA MaterialSpinner offers various customization options to suit your app’s design:


You can adjust the size of the spinner by setting its frame property to the desired dimensions.


To change the color of the spinner, modify the spinnerColor property. You can set it to any valid color value, such as .red or #FFFFFF.

Animation Speed

The spinner’s animation speed can be adjusted using the animationDuration property. The value should be in seconds.

Complete Example

Here’s an example that demonstrates how to use AA MaterialSpinner:

// Import the library
import AAMaterialSpinner

class ViewController: UIViewController {
    override func viewDidLoad() {
        // Create an instance of the spinner
        let spinner = AAMaterialSpinner(frame: CGRect(x: 0, y: 0, width: 50, height: 50))
        // Customize the spinner's appearance
        spinner.spinnerColor = .red
        // Add the spinner to the view hierarchy
        // Start animating the spinner
        // Stop the spinner animation after a delay
        DispatchQueue.main.asyncAfter(deadline: .now() + 3.0) {


Congratulations! You have successfully integrated the AA MaterialSpinner library into your iOS application. This powerful tool allows you to add visually appealing loading spinners to enhance user experience. Feel free to experiment with different customizations to suit your app’s design requirements.