Skip to content

Files

Latest commit

 

History

History
41 lines (20 loc) · 651 Bytes

closure_spacing.md

File metadata and controls

41 lines (20 loc) · 651 Bytes

Pattern: Malformed closure spacing

Issue: -

Description

Closure expressions should have a single space inside each brace.

Examples of correct code:

[].map ({ $0.description })


[].filter { $0.contains(location) }


extension UITableViewCell: ReusableView { }


extension UITableViewCell: ReusableView {}

Examples of incorrect code:

[].filter({$0.contains(location)})


[].map({$0})


({each in return result.contains(where: {e in return e}) }).count


filter { sorted { $0 < $1}}

Further Reading