Skip to content

Commit 44ea477

Browse files
committed
Struct-scope constants: More Swift-like?
1 parent 4232e52 commit 44ea477

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,8 @@ let bounds = CGRectMake(40, 20, 120, 80)
309309
var centerPoint = CGPointMake(96, 42)
310310
```
311311

312+
Prefer the struct-scope constants `CGRect.infiniteRect`, `CGRect.nullRect`, etc. over global constants `CGRectInfinite`, `CGRectNull`, etc. For existing variables, you can use the shorter `.zeroRect`.
313+
312314
### Type Inference
313315

314316
The Swift compiler is able to infer the type of variables and constants. You can provide an explicit type via a type alias (which is indicated by the type after the colon), but in the majority of cases this is not necessary.

0 commit comments

Comments
 (0)