The problem I am trying to solve is that I can't stack let statements in a guard statement if in the middle I need to set a non-optional value (think parsing some huge JSON object):
guard
let foo = dict[someKey] as? [String: Any],
let moo = foo[anotherKey] as? [String],
moo.count > 2,
case let whatIwant = moo[1],
...
I was actually given this technique years ago in Swift 2 or something, on this forum!
So I'm using it now in Swift 4.1, and started wondering - why is this possible? I looked at the Swift Programming Language, and all I can find is something on "Optional Patterns", but the examples and discussion really don't fit.
Why does this work?