Skip to content

Instantly share code, notes, and snippets.

@edopelawi
Created August 30, 2016 14:00
Embed
What would you like to do?
A sample on using force-unwrap against an String optional.
name = "Ol' Man Jenkins"
// This call will work, since it has a valid value.
print(createGreetings(sailorName: name!))
name = nil
// This call will cause an error, since `name` has no value at this point.
print(createGreetings(sailorName: name!))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment