SwiftLoader

1.1.0

A simple and beautiful activity indicator written in Swift
leoru/SwiftLoader

What's New

SPM Support

2023-07-26T08:10:22Z

SwiftLoader

SwiftLoader is a simple and beautiful activity indicator.

Example

Usage

In case you installed SwiftLoader via CocoaPods you need to import it (add this somewhere at the top of your source code file):

import SwiftLoader

Show SwiftLoader without text:

  SwiftLoader.show(animated: true)

Show SwiftLoader with text:

  SwiftLoader.show(title: "Loading...", animated: true)

Hide SwiftLoader:

  SwiftLoader.hide()

Configuration

SwiftLoader has simple configuration system.

You need to create SwiftLoader.Config object, set params:

  var config : SwiftLoader.Config = SwiftLoader.Config()
  config.size = 150
  config.spinnerColor = .redColor()
  config.foregroundColor = .blackColor()
  config.foregroundAlpha = 0.5

and set new config for SwiftLoader:

  SwiftLoader.setConfig(config)

Current available params:

  • size - Size of loader
  • spinnerColor - Color of spinner view
  • spinnerLineWidth - Line width of spinner view layer
  • titleTextColor - Color of title text
  • titleTextFont - Font of title text
  • backgroundColor - Background color for loader
  • foregroundColor - Foreground color for loader
  • cornerRadius - Radius of corners of loader
  • foregroundAlpha - Alpha property for foreground

Install

CocoaPods

SwiftSpinner is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'SwiftLoader', '1.1.0'

Swift Package Manager

Add as a dependecy to your Swift Package

dependencies: [ .package(url: "https://github.com/leoru/SwiftLoader.git", branch: "master") ]

In case you don’t want to use CocoaPods - just copy the file SwiftLoader/SwiftLoader.swift to your Xcode project.

Maintainers

License

SwiftLoader is available under the MIT license.

Description

  • Swift Tools 5.8.0
View More Packages from this Author

Dependencies

  • None
Last updated: Fri Oct 18 2024 03:56:54 GMT-0900 (Hawaii-Aleutian Daylight Time)