Swift’s “if case let” Syntax
Zoe Smith (via Jim Correia):
case letimmediately precedes the candidate pattern in both versions. However, when usingif case letthe value comes after the=operator[…]
case letis a shortcut so all subsequent associated values can be bound just by providing variable names.[…]
Add conditions to
ifandguardusing commas[…]
Iterate using
for,whereand logical operators
See also: Swift Closures and Objective-C Blocks.
2 Comments RSS · Twitter
The existence of these “fucking___syntax.com” web sites is a testament to obscure and over-wrought syntactical design, and it's disheartening to witness their need in a shiny new language like Swift.