Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

删除多余空格 #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions README-En.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ switch (condition) {
// ...
// Multi-line example using braces
break;
}
}
case 3:
// ...
break;
Expand Down Expand Up @@ -1267,27 +1267,27 @@ if (user.isHappy)
**Preferred:**

```objective-c
[UIView animateWithDuration:1.0
animations:^{
// something
}
completion:^(BOOL finished) {
// something
}];
[UIView animateWithDuration:1.0 animations:^{
// something
} completion:^(BOOL finished) {
// something
}];
```


**Not Preferred:**

```objective-c
[UIView animateWithDuration:1.0 animations:^{
// something
} completion:^(BOOL finished) {
[UIView animateWithDuration:1.0
animations:^{
// something
}
completion:^(BOOL finished) {
// something
}];
```

If auto indentation falls into bad readability, declare blocks in variables before or reconsider your method signature.
Xcode 12 auto indentation falls into bad readability.

### Line Breaks
Line breaks are an important topic since this style guide is focused for print and online readability.
Expand Down
24 changes: 11 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ switch (condition) {
// ...
// Multi-line example using braces
break;
}
}
case 3:
// ...
break;
Expand Down Expand Up @@ -1456,28 +1456,26 @@ if (user.isHappy)
**推荐:**

```objective-c
[UIView animateWithDuration:1.0
animations:^{
// something
}
completion:^(BOOL finished) {
// something
}];

[UIView animateWithDuration:1.0 animations:^{
// something
} completion:^(BOOL finished) {
// something
}];
```


**不推荐:**

```objective-c
[UIView animateWithDuration:1.0 animations:^{
[UIView animateWithDuration:1.0
animations:^{
// something
} completion:^(BOOL finished) {
}
completion:^(BOOL finished) {
// something
}];
```

如果自动对齐让可读性变得糟糕,那么应该在之前把 block 定义为变量,或者重新考虑你的代码签名设计
Xcode 12 的自动对齐让可读性变得糟糕

### 换行

Expand Down