From e132b54c9fed98bdbf089cbc227d60f0bf4ddf1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sat, 2 Apr 2016 08:41:19 +0200 Subject: [PATCH] FetchedRecordsController documentation --- GRDB/Record/FetchedRecordsController.swift | 9 +++++++-- TODO.md | 1 - 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/GRDB/Record/FetchedRecordsController.swift b/GRDB/Record/FetchedRecordsController.swift index 0ddbe723a..592609112 100644 --- a/GRDB/Record/FetchedRecordsController.swift +++ b/GRDB/Record/FetchedRecordsController.swift @@ -332,15 +332,20 @@ public final class FetchedRecordsController { } /// Updates the fetch request, and notifies the delegate of changes in the - /// fetched records. + /// fetched records if delegate is not nil, and performFetch() has been + /// called. public func setRequest(request: FetchRequest) { + // We don't provide a setter for the request property because we need a + // non-optional request. + // Retype the fetch request let request: FetchRequest = FetchRequest(query: request.query) self.source = DatabaseSource.FetchRequest(request) } /// Updates the fetch request, and notifies the delegate of changes in the - /// fetched records. + /// fetched records if delegate is not nil, and performFetch() has been + /// called. public func setSQL(sql: String, arguments: StatementArguments? = nil) { self.source = DatabaseSource.SQL(sql, arguments) } diff --git a/TODO.md b/TODO.md index dff517235..a4e253489 100644 --- a/TODO.md +++ b/TODO.md @@ -1,6 +1,5 @@ - [ ] Make FetchRequest adopt Equatable - [ ] FetchedRecordsController needs a property that disables changes computation and calls to delegate.controller(_:didChangeRecord:withEvent:). -- [ ] Turn FetchedRecordsController.setRequest into the request property setter. - [ ] DatabaseValue.failableValue() is not a nice name. - [ ] Support for resource values (see https://developer.apple.com/library/ios/qa/qa1719/_index.html) - [ ] DOC: Write an app like http://www.appcoda.com/swiftydb/ ?