Skip to content

Instantly share code, notes, and snippets.

@philsquared
Created February 11, 2015 17:39
Show Gist options
  • Save philsquared/9502d898635eb1afc308 to your computer and use it in GitHub Desktop.
Save philsquared/9502d898635eb1afc308 to your computer and use it in GitHub Desktop.
if let chaining
var a : Int? = 11
var b : Int? = 20
if let a = a,
let b = b,
let c = { () -> Int? in
return a > 10 ? a+b : nil
} () {
println( "c: \(c)" )
}
else {
println( "nope" )
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment