Protocol to handle initial Loadings, Empty Views and Error Handling in a ViewController & views
Clone or download
Latest commit bcb10c3 Sep 15, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Github Screenshots updated screenshots Sep 21, 2016
StatusProvider Example.xcodeproj Support swift 4.2 Sep 14, 2018
StatusProvider Fixed tvOS Build Sep 14, 2018
.gitignore Initial commit Aug 25, 2016
.swift-version Fixed Swift Version Oct 9, 2017
LICENSE Initial commit Aug 25, 2016
Podfile Carthage Support Jun 1, 2017
Podfile.lock Pod Update Aug 26, 2016
README.md Update README.md Jun 1, 2017
StatusProvider.podspec Fixed tvOS Build Sep 14, 2018

README.md

Carthage compatible

StatusProvider

Screenshot

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