1
- 郑重声明:
2
- 如果看不懂,估计是我翻译的不好
3
- 233333
1
+ 郑重声明:
2
+ 如果看不懂,估计是我翻译的不好
3
+ 233333
4
4
5
- ##[ 原版] ( https://github.com/github/swift-style-guide ) 戳这里
5
+ ##[ 原版] ( https://github.com/github/swift-style-guide ) 戳这里
6
6
7
- 哪里不对或者不准确的,若能指出(我把原文贴上来了,用来对照 2015-12-13)
8
- 感激不尽~~~
7
+ 哪里不对或者不准确的,若能指出(我把原文贴上来了,用来对照 2015-12-13)
8
+ 感激不尽~~~
9
9
10
- 如果没能及时更新,可能比较忙,或者比较懒 →_ →
10
+ 如果没能及时更新,可能比较忙,或者比较懒 →_ →
11
11
可以 ` Email ` 或 翻译后,` pull request `
12
12
13
13
14
14
---
15
15
16
- #Swift 编码规范
16
+ #Swift 编码规范
17
17
18
18
A guide to our Swift style and conventions.
19
19
@@ -80,9 +80,9 @@ Accordingly, whenever you see a `var` identifier being used, assume that it will
80
80
这样,无论何时你看到 ` var ` ,就假设它会变,并问自己为啥。
81
81
82
82
#### Return and break early
83
- #### 尽早地 ` Return ` 或者 ` break `
83
+ #### 尽早地 ` Return ` 或者 ` break `
84
84
85
- When you have to meet certain criteria to continue execution, try to exit early. So, instead of this:
85
+ When you have to meet certain criteria to continue execution, try to exit early. So, instead of this:
86
86
87
87
当你遇到某些操作需要通过条件判断去执行,应当尽早地退出判断条件:你不应该用下面这种写法
88
88
@@ -106,7 +106,7 @@ You can also do it with `if` statement, but using `guard` is prefered, because `
106
106
107
107
或者你也可以用 ` if ` 声明,但是我们推荐你使用 ` guard `
108
108
109
- _ 理由:_ 你一但声明 ` guard ` 编译器会强制要求你和 ` return ` , ` break ` 或者 ` continue ` 一起搭配使用,否则会产生一个编译时的错误。
109
+ _ 理由:_ 你一但声明 ` guard ` 编译器会强制要求你和 ` return ` , ` break ` 或者 ` continue ` 一起搭配使用,否则会产生一个编译时的错误。
110
110
111
111
112
112
#### Avoid Using Force-Unwrapping of Optionals
0 commit comments