From 344a5c068dca32b9ce04e7df08654ba64d3d1e90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 7 Jan 2016 19:05:23 +0100 Subject: [PATCH] README.md --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 02274b987..054aacc1c 100644 --- a/README.md +++ b/README.md @@ -455,15 +455,19 @@ if let databaseValue = row["date"] { } ``` -Row adopts the CollectionType protocol: you can iterate all the tuples (columnName, databaseValue) in a row, from left to right: +Row adopts the CollectionType protocol: ```swift +// the number of columns +row.count + +// All the (columnName, databaseValue) tuples, from left to right: for (columnName, databaseValue) in row { ... } ``` -Rows are not real dictionaries, though. They may contain duplicate keys: +Rows are not real dictionaries, though, since they may contain duplicate keys: ```swift let row = Row.fetchOne(db, "SELECT 1 AS foo, 2 AS foo")!