Created
December 22, 2017 16:41
-
-
Save mahmudahsan/b9b667cf71f48f1af0c995caee5afff2 to your computer and use it in GitHub Desktop.
Error handling in swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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