Improving Closure Hygiene
Each closure starts with an optional signature declaration that concludes with the in keyword. It’s followed by statements that form the closure’s body. Closures expressions may include any or all of the following components:
|||[capture-list] (parameters and their types) throws -> result-type in|
Add declaration elements reluctantly, preferring to include just those items required to make your closure compile and function properly. Any element that can be inferred often should be inferred. After that, follow your in-house standards regarding additional declaration items. Most Swift developers omit return and parameter types where allowed. A short signature is generally both readable and useful. ...