Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mariohahn/StatusProvider
Protocol to handle initial Loadings, Empty Views and Error Handling in a ViewController & views
https://github.com/mariohahn/StatusProvider
empty error-handling loading protocol viewcontroller
Last synced: 7 days ago
JSON representation
Protocol to handle initial Loadings, Empty Views and Error Handling in a ViewController & views
- Host: GitHub
- URL: https://github.com/mariohahn/StatusProvider
- Owner: mariohahn
- License: mit
- Created: 2016-08-25T12:35:39.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-14T17:01:25.000Z (about 6 years ago)
- Last Synced: 2024-11-29T13:00:00.856Z (14 days ago)
- Topics: empty, error-handling, loading, protocol, viewcontroller
- Language: Swift
- Homepage:
- Size: 362 KB
- Stars: 879
- Watchers: 22
- Forks: 47
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios-star - StatusProvider - Protocol to handle initial Loadings, Empty Views and Error Handling in a ViewController & views. (UI / Font)
- awesome-ios - StatusProvider - Protocol to handle initial Loadings, Empty Views and Error Handling in a ViewController & views. (UI / Font)
README
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
# StatusProvider
![Screenshot](https://github.com/mariohahn/StatusProvider/blob/master/Github%20Screenshots/StatusProvider.png?raw=true)
Protocol to handle initial Loadings, Empty Views and Error Handling in a ViewController & views
## CocoaPods Podfile
```ruby
pod 'StatusProvider'
```## Functions
* Loading
* EmptyView
* Error Handling## How to use?
```swiftclass ErrorViewController: UIViewController, StatusController {
override func viewDidLoad() {
super.viewDidLoad()title = "Error"
let status = Status(title: "Error", description: "Oh... fu**", actionTitle: "Retry ๐") {
}
show(status: status)
}
}class ActivityViewController: UIViewController, StatusController {
override func viewDidLoad() {
super.viewDidLoad()title = "Loading"
let status = Status(isLoading: true, description: "Lรคdtโฆ")
show(status: status)
}
}class EmptyViewController: UIViewController, StatusController {
override func viewDidLoad() {
super.viewDidLoad()title = "Empty"
let status = Status(title: "no Data", description: "No data available.๐ฃ", actionTitle: "Create โญ๏ธ", image: UIImage(named: "placeholder_instagram")) {
self.hideStatus()
}show(status: status)
}
}```