Skip to content

Instantly share code, notes, and snippets.

@mahmudahsan
Created December 22, 2017 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mahmudahsan/b9b667cf71f48f1af0c995caee5afff2 to your computer and use it in GitHub Desktop.
Save mahmudahsan/b9b667cf71f48f1af0c995caee5afff2 to your computer and use it in GitHub Desktop.
Error handling in swift
let str = try? sampleThrowError()
if let str = str {
print(str)
}
else {
print("Str is nil")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment