Please explain why this works?
func howMany() -> Int {return 11}
guard case let output = howMany(), output > 10 else {return}
I understand how guard / if / while / for case let works with enums. Matching patterns is great. But there is no listing here, and that works too. What is a language construct that allows this?
(This example was taken from a book by Matt Neuburg.)
source
share