Swiftpack.co - VladimirBrejcha/LoadingView as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by VladimirBrejcha.
VladimirBrejcha/LoadingView v1.0.3
Easy to use, highly customisable, animated view to display a loading
⭐️ 4
πŸ•“ 1 week ago
iOS
.package(url: "https://github.com/VladimirBrejcha/LoadingView.git", from: "v1.0.3")

LoadingView

LoadingView is an highly customizable and easy to use UI element for showing loading status written in Swift.

Preview

Features

  • β˜‘ Show animated loading
  • β˜‘ Show an information message
  • β˜‘ Show an error message with repeat button
  • β˜‘ Customize colors, fonts, animations
  • β˜‘ Import your own loading animation
  • β˜‘ Use in code or from interface builder

Requirements

  • iOS 10.0+
  • Xcode 11+
  • Swift 5.1+

Installation

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler.

Use Xcode’s new Swift Packages option, which is located within the File menu.

Usage example

ExampleApp

import LoadingView

class ViewController: UIViewController {
    @IBOutlet weak var loadingView: LoadingView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        loadingView.repeatTouchUpHandler = { button in
            // handle repeatButton touches
        }
        loadingView.state = .loading // set loadingView state
    }
}

States

hidden

View is fully hidden

loading

View is showing loading animation

info

View is showing information with the given message

error

View is showing error with the given messsage and repeat button

Advanced

Use your own animations instead of default PulsingCircleAnimation

Create an animation and conform it to the Animation protocol. Set the loadingAnimation property.

loadingView.loadingAnimation = MyAnimation() // must conform to Animation protocol

Turn on state change logging

loadingView.logStateChanges = true // enable logging if needed

Credits

Example photo by Jason Leung on Unsplash

License

LoadingView is released under the MIT license. See LICENSE for details.

GitHub

link
Stars: 4
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Related Packages

Release Notes

v1.0.3
1 week ago
  • Add restoreAnimation method in case animation was removed from the layer

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics