From 36292ce4ef0fba0ad6cc8c9c25a3f2ce583a3aa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 3 Sep 2015 14:02:38 +0200 Subject: [PATCH] Documentation for compound RowModel properties. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5162ffa6f..6d22b9202 100644 --- a/README.md +++ b/README.md @@ -887,11 +887,13 @@ class Placemark : RowModel { } ``` -A solution is of course to declare two internal properties, latitude and longitude, and implement coordinate as a computed property. `setDatabaseValue()` would simply update latitude and longitude separately: +A solution is of course to declare two convenience properties, latitude and longitude, and implement coordinate on top of them, as a computed property. `setDatabaseValue()` would then update latitude and longitude separately: ```swift // Solution 1: computed property: class Placemark : RowModel { + var latitude: CLLocationDegrees? + var longitude: CLLocationDegrees? var coordinate: CLLocationCoordinate2D? { switch (latitude, longitude) { case (let latitude?, let longitude?): @@ -901,8 +903,6 @@ class Placemark : RowModel { return nil } } - var latitude: CLLocationDegrees? - var longitude: CLLocationDegrees? override func setDatabaseValue(dbv: DatabaseValue, forColumn column: String) { switch column {