You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+45-15Lines changed: 45 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,21 +33,47 @@ This guide was last updated for Swift 4.0 on February 14, 2018.
33
33
***1.2** Avoid uncomfortably long lines with a hard maximum of 160 characters per line (Xcode->Preferences->Text Editing->Page guide at column: 160 is helpful for this)
34
34
***1.3** Ensure that there is a newline at the end of every file.
35
35
***1.4** Ensure that there is no trailing whitespace anywhere (Xcode->Preferences->Text Editing->Automatically trim trailing whitespace + Including whitespace-only lines).
36
-
***1.5**Do not place opening braces on new lines - we use the [1TBS style](https://en.m.wikipedia.org/wiki/Indentation_style#1TBS).
36
+
***1.5**For single-line statements, keep the opening braces on the same line. For multi-line statements, place the closing parentheses and opening braces on separate lines. This adheres to the default style defined by [swift-format](https://github.com/swiftlang/swift-format).
37
37
38
38
```swift
39
39
classSomeClass {
40
-
funcsomeMethod() {
40
+
// For single-line statements, keep the opening braces on the same line.
***1.9** We follow Xcode's recommended indentation style (i.e. your code should not change if CTRL-I is pressed). When declaring a function that spans multiple lines, prefer using that syntax to which Xcode, as of version 7.3, defaults.
129
+
***1.9** We follow Xcode's recommended indentation style (i.e. your code should not change if CTRL-I is pressed). For multi-line function declarations, use the syntax that [swift-format](https://github.com/swiftlang/swift-format) defaults to in Xcode 16.0 or later.
104
130
105
131
```swift
106
-
// Xcode indentation for a function declaration that spans multiple lines
0 commit comments