Skip to content

Commit 1bb8fec

Browse files
committed
Merge pull request kodecocodes#51 from gregheo/issue-51
new struct inits over old C functions
2 parents e01cee3 + 44ea477 commit 1bb8fec

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)