Skip to content

Instantly share code, notes, and snippets.

@nhathm
Created March 20, 2017 18:22
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 nhathm/429c3e55c4facb10565acaf1d9a05e76 to your computer and use it in GitHub Desktop.
Save nhathm/429c3e55c4facb10565acaf1d9a05e76 to your computer and use it in GitHub Desktop.
Guard multi condition
let name : String? = "Swift"
let version : Int = 3
let owner : String = "Apple"
func checkMultiCondition(name : String?, version : Int, owner : String) {
guard let name = name, version > 2, owner == "Apple" else {
print("Input parameters not match!!!")
return
}
print(name)
print(version)
print(owner)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment