March 2017
Intermediate to advanced
226 pages
5h 13m
English
In Swift, it’s common to break down parenthesized argument lists to multiple lines when working with complex calls, both at the declaration site and at call sites. Here are three examples from the Swift standard library that showcase multilined parenthesized argument lists:
| | // Declaration arguments on their own line: "Brace Like" |
| | public func zip<Sequence1 : Sequence, Sequence2 : Sequence>( |
| | _ sequence1: Sequence1, _ sequence2: Sequence2 |
| | ) -> Zip2Sequence<Sequence1, Sequence2> { ... } |
| | |
| | // Callsite line-by-line arguments, with dangling |
| | // end parenthesis |
| | return Index( |
| | _base: UnicodeScalarView.Index( |
| | _position: i._utf16Index - predecessorLengthUTF16 |
| | ), |
| | in: self |
| |
Read now
Unlock full access