Skip to content

Instantly share code, notes, and snippets.

@mwrites
Created September 19, 2016 07:00
Show Gist options
  • Save mwrites/8230f85e9652ef232e63907bd6ed71e2 to your computer and use it in GitHub Desktop.
Save mwrites/8230f85e9652ef232e63907bd6ed71e2 to your computer and use it in GitHub Desktop.
enum SvcError: ErrorType {
case Bla
case Blo
case Code(Int)
}
let e: ErrorType = SvcError.Code(3)
print(e)
if e is SvcError {
if let svcError = e as? SvcError, case let .Code(c) = svcError {
print(c)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment