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
Update NSString to String
Remove extraneous "() -> () in" after closure brace
Add "-" after "// Mark:" which will add a line in the method list dropdown
Added single space after "//"
Copy file name to clipboardExpand all lines: README.markdown
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ class app_widgetContainer {
60
60
For functions and init methods, prefer named parameters for all arguments unless the context is very clear. Include external parameter names if it makes function calls more readable.
@@ -123,20 +123,20 @@ If you need to expose a Swift type for use within Objective-C you can provide a
123
123
**Preferred:**
124
124
```swift
125
125
if user.isHappy {
126
-
//Do something
126
+
//Do something
127
127
} else {
128
-
//Do something else
128
+
//Do something else
129
129
}
130
130
```
131
131
132
132
**Not Preferred:**
133
133
```swift
134
134
if user.isHappy
135
135
{
136
-
//Do something
136
+
//Do something
137
137
}
138
138
else {
139
-
//Do something else
139
+
//Do something else
140
140
}
141
141
```
142
142
@@ -218,11 +218,11 @@ Use `self` when required to differentiate between property names and arguments i
218
218
classBoardLocation {
219
219
let row: Int, column: Int
220
220
221
-
init(row: Int,column: Int) {
221
+
init(row: Int,column: Int) {
222
222
self.row= row
223
223
self.column= column
224
224
225
-
let closure = { () -> () in
225
+
let closure = {
226
226
println(self.row)
227
227
}
228
228
}
@@ -233,7 +233,7 @@ class BoardLocation {
233
233
234
234
When adding protocol conformance to a class, prefer adding a separate class extension for the protocol methods. This keeps the related methods grouped together with the protocol and can simplify instructions to add a protocol to a class with its associated methods.
235
235
236
-
Also, don't forget the `// MARK` comment to keep things well-organized!
236
+
Also, don't forget the `// MARK: -` comment to keep things well-organized!
237
237
238
238
**Preferred:**
239
239
```swift
@@ -324,14 +324,14 @@ Always use Swift's native types when available. Swift offers bridging to Objecti
324
324
325
325
**Preferred:**
326
326
```swift
327
-
let width =120.0//Double
328
-
let widthString = (width as NSNumber).stringValue//String
327
+
let width =120.0//Double
328
+
let widthString = (width as NSNumber).stringValue//String
329
329
```
330
330
331
331
**Not Preferred:**
332
332
```swift
333
-
let width: NSNumber =120.0//NSNumber
334
-
let widthString: NSString = width.stringValue//NSString
333
+
let width: NSNumber =120.0//NSNumber
334
+
let widthString: NSString = width.stringValue//NSString
335
335
```
336
336
337
337
In Sprite Kit code, use `CGFloat` if it makes the code more succinct by avoiding too many conversions.
0 commit comments