StatusProvider
  • August 8, 2023

Protocol to handle initial Loadings, Empty Views and Error Handling in a ViewController & views

CocoaPods Podfile


pod ‘StatusProvider’

Functions


  • Loading
  • EmptyView
  • Error Handling

How to use?


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)
}
}

GitHub


View Github

#empty #errorhandling #loading #protocol #viewcontroller
YOU MIGHT ALSO LIKE...
CameraBackground

Features Both front and back camera supported. Flash modes: auto, on, off. Countdown timer. Tap to focus. Pinch to zoom. Usage  

DKCamera

Description A light weight & simple & easy camera for iOS by Swift. It uses CoreMotion framework to detect device orientation, so ...

HorizonSDK-iOS

Horizon SDK is a state of the art real-time video recording / photo shooting iOS library. Some of the features ...

LLSimpleCamera

LLSimpleCamera: A simple customizable camera - video recorder control LLSimpleCamera is a library for creating a customized camera - video ...

RSBarcodes_Swift

RSBarcodes allows you to read 1D and 2D barcodes using the metadata scanning capabilities introduced with iOS 7 and generate ...