From 63cecd884fe37e0dd182f35a42152df94586564d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Tue, 3 Nov 2015 19:15:24 +0100 Subject: [PATCH] README.md --- README.md | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/README.md b/README.md index 7aab6ab42..42a7eff39 100644 --- a/README.md +++ b/README.md @@ -1552,36 +1552,6 @@ The `updateFromRow` method updates properties from the columns found in the row. > > :point_up: **Note**: For performance reasons, the same row argument to `updateFromRow` is reused for all records during the iteration of a fetch query. If you want to keep the row for later use, make sure to store a copy: `self.row = row.copy()`. -The example classes above have one property per database column. You can of course do otherwise: - -```swift -// CREATE TABLE pois ( -// title TEXT NOT NULL, -// latitude DOUBLE NOT NULL, -// longitude DOUBLE NOT NULL, -// ) -class PointOfInterest : Record { - var title: String? - var coordinate: CLLocationCoordinate2D? - - override class func databaseTableName() -> String? { - return "pois" - } - - override var storedDatabaseDictionary: [String: DatabaseValueConvertible?] { - return ["title": title, "latitude": coordinate.latitude, "longitude": coordinate.latitude] - } - - override func updateFromRow(row: Row) { - if let dbv = row["title"] { title = dbv.value() } - if let dbLat = row["latitude"], let dbLon = row["longitude"] { - coordinate = CLLocationCoordinate2DMake(dbLat.value(), dbLon.value()) - } - super.updateFromRow(row) // Subclasses are required to call super. - } -} -``` - ### Fetching Records