Merge master -> no-force-unwrapping

This commit is contained in:
Christopher Denter 2014-12-01 21:58:22 +01:00
Родитель ee49df9581 8e94807ae3
Коммит 8d7e6daafe
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -11,7 +11,6 @@ rough priority order):
If you have suggestions, please see our [contribution guidelines](CONTRIBUTING.md),
then open a pull request. :zap:
----
#### Whitespace
@ -57,6 +56,12 @@ foo?.callSomethingIfFooIsNotNil()
_Rationale:_ Explicit `if let`-binding of optionals results in safer code. Force unwrapping is more prone to lead to runtime crashes.
#### Avoid Using Implicitly Unwrapped Optionals
Where possible, use `let foo: FooType?` instead of `let foo: FooType!` if foo may be nil (Note that in general, `?` can be used instead of `!`).
_Rationale:_ Explicit optionals result in safer code. Implicitly unwrapped optionals have the potential of crashing at runtime.
#### Prefer implicit getters on read-only properties and subscripts
When possible, omit the `get` keyword on read-only computed properties and