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: 8 months 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 9 years ago)
- Default Branch: master
- Last Pushed: 2018-09-14T17:01:25.000Z (over 7 years ago)
- Last Synced: 2025-04-12T23:40:03.004Z (8 months ago)
- Topics: empty, error-handling, loading, protocol, viewcontroller
- Language: Swift
- Homepage:
- Size: 362 KB
- Stars: 875
- Watchers: 22
- Forks: 47
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/Carthage/Carthage)
# StatusProvider

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?
```swift
class 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)
}
}
```