From 6dcddedcb47fa89556a1ff594978e72766747e53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 27 Sep 2015 21:12:28 +0200 Subject: [PATCH] README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b528d25cf..04c0117d4 100644 --- a/README.md +++ b/README.md @@ -283,7 +283,7 @@ let name: String = row.value(atIndex: 0) let name: String = row.value(named: "name") ``` -Use optionals when the value may be NULL: +Ask for an optional when the value may be NULL: ```swift let name: String? = row.value(named: "name") @@ -300,11 +300,12 @@ let dateString: String = row.value(named: "date") // "2015-09-11 18:14:15. let date: NSDate = row.value(named: "date") // NSDate ``` -**WARNING**: You can use the `as` type casting operator, but beware (see [rdar://21676393](http://openradar.appspot.com/radar?id=4951414862249984)): +You can also use the `as` type casting operator, but **beware** (see [rdar://21676393](http://openradar.appspot.com/radar?id=4951414862249984)): ```swift row.value(...) as Int // OK: Int row.value(...) as Int? // OK: Int? +row.value(...) as Int! // OK: Int! row.value(...) as! Int // NO NO NO DON'T DO THAT! row.value(...) as? Int // NO NO NO DON'T DO THAT! ```