fix warning: self’ refers to the method ‘LoadingView.self’, which may be unexpected
LoadingView is an highly customizable and easy to use UI element for showing loading status written in Swift.
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler.
swift
Use Xcode’s new Swift Packages option, which is located within the File menu.
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 } }
View is fully hidden
View is showing loading animation
View is showing information with the given message
View is showing error with the given messsage and repeat button
Create an animation and conform it to the Animation protocol. Set the loadingAnimation property.
loadingView.loadingAnimation = MyAnimation() // must conform to Animation protocol
loadingView.logStateChanges = true // enable logging if needed
Example photo by Jason Leung on Unsplash
LoadingView is released under the MIT license. See LICENSE for details.
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
LoadingView
LoadingView is an highly customizable and easy to use UI element for showing loading status written in Swift.
Features
Requirements
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
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.
Turn on state change logging
Credits
Example photo by Jason Leung on Unsplash
License
LoadingView is released under the MIT license. See LICENSE for details.