March 2017
Intermediate to advanced
226 pages
5h 13m
English
The Swift developer community has adopted spacing conventions for many language elements. The following overview reviews the most common spacing conventions used in Swift code and considers whether the spacing style is universal or not:
statement; statement
Left-hugging, space follows.
x, y
Left-hugging, space follows.
Type<T, U> vs. Type<T,U>
Most developers add spacing after the comma, allowing the generic type parameters to breathe. A few developers omit spaces, stating that when generic parameters are part of the return type, “it seems strange to break the return type into two chunks by throwing a space in there.” Omitting spaces ensures that Xcode wraps an entire type (for ...
Read now
Unlock full access