Skip to content

Instantly share code, notes, and snippets.

@bill350
Created March 29, 2018 19:50
Show Gist options
  • Save bill350/5dff699d0102d2f2078f8308072561ca to your computer and use it in GitHub Desktop.
Save bill350/5dff699d0102d2f2078f8308072561ca to your computer and use it in GitHub Desktop.
/// Errors prompting protocol at its core
protocol FailableCore {
/// Show an error
func showError(_ error: Swift.Error?)
}
/// Failable protocol to display error
protocol Failable: FailableCore {
var errorScreenType: ErrorScreen? {get}
var errorContext: ErrorContext {get}
/// Show an error using an error view with a retry option
func showError<T: ErrorDisplayable>(_ error: Swift.Error?, errorView: T.Type, _ reloadable: Reloadable)
/// Show an error with a retry button
func showError(_ error: Swift.Error?, _ reloadable: Reloadable & Failable)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment