Skip to content

Instantly share code, notes, and snippets.

@Zlobrynya
Created January 17, 2022 13:53
Show Gist options
  • Save Zlobrynya/488cc2ba8eef8d147f8da97ea31d11f2 to your computer and use it in GitHub Desktop.
Save Zlobrynya/488cc2ba8eef8d147f8da97ea31d11f2 to your computer and use it in GitHub Desktop.
enum WeatherError: LocalizedError {
case cityIsInTheListAlready(String)
case noLocationAccess(String)
case nothingFound
var localizedDescription: String {
switch self {
case .cityIsInTheListAlready(let string): return "Error Description"
case .noLocationAccess(let string): return "Error Description"
case .nothingFound: return "Ooops.. Nothing found!"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment