Skip to content

Instantly share code, notes, and snippets.

@JohannMG
Created February 9, 2016 19:40
Show Gist options
  • Save JohannMG/cf6c63ad27848e950609 to your computer and use it in GitHub Desktop.
Save JohannMG/cf6c63ad27848e950609 to your computer and use it in GitHub Desktop.
// >:D
var fns = Array< (String?) -> Bool >()
fns.append( {( input: String?) -> Bool in
return input == "hello"
})
fns.append { (input: String?) -> Bool in
return input == ""
}
fns.forEach { (inputs) -> () in
print ( inputs(""))
}
//prints:
//false
//true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment