Skip to content

Instantly share code, notes, and snippets.

@amlcurran
Created September 14, 2017 08:40
Show Gist options
  • Save amlcurran/eed0ff6fbca488d8e82e0557cff815de to your computer and use it in GitHub Desktop.
Save amlcurran/eed0ff6fbca488d8e82e0557cff815de to your computer and use it in GitHub Desktop.
func displayErrorMessage(_ optionalMessage: String?) {
if let message = optionalMessage {
print(message)
}
}
displayErrorMessage("Something went wrong") // Prints out "Something went wrong"
displayErrorMessage(nil) // doesn't do anything
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment