Skip to content

Instantly share code, notes, and snippets.

@haikieu
Created August 15, 2018 07:10
Show Gist options
  • Save haikieu/1e9d110445898e6b5179d980f279ff5a to your computer and use it in GitHub Desktop.
Save haikieu/1e9d110445898e6b5179d980f279ff5a to your computer and use it in GitHub Desktop.
unwrap optional type by guard
var optionalString : String?
guard let theString = optionalString else {
return
}
//do something with theString
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment