GRDB.swift v0.62.0 Release Notes
-
๐ Released May 12, 2016
๐ฅ Breaking Changes
๐ FetchedRecordsController has been refactored (documentation):
- delegate has been replaced by callbacks
- features that target UITableView are now iOS only.
final class FetchedRecordsController<Record: RowConvertible> { - weak var delegate: FetchedRecordsControllerDelegate? - func recordAtIndexPath(indexPath: NSIndexPath) -> Record - func indexPathForRecord(record: Record) -> NSIndexPath? - var sections: [FetchedRecordsSectionInfo<Record>] + #if os(iOS) + typealias WillChangeCallback = FetchedRecordsController<Record> -> () + typealias DidChangeCallback = FetchedRecordsController<Record> -> () + typealias TableViewEventCallback = (controller: FetchedRecordsController<Record>, record: Record, event: TableViewEvent) -> () + func trackChanges( + recordsWillChange willChangeCallback: WillChangeCallback? = nil, + tableViewEvent tableViewEventCallback: TableViewEventCallback? = nil, + recordsDidChange didChangeCallback: DidChangeCallback? = nil) + func recordAtIndexPath(indexPath: NSIndexPath) -> Record + func indexPathForRecord(record: Record) -> NSIndexPath? + var sections: [FetchedRecordsSectionInfo<Record>] + #else + typealias WillChangeCallback = FetchedRecordsController<Record> -> () + typealias DidChangeCallback = FetchedRecordsController<Record> -> () + func trackChanges( + recordsWillChange willChangeCallback: WillChangeCallback? = nil, + recordsDidChange didChangeCallback: DidChangeCallback? = nil) + #endif } -protocol FetchedRecordsControllerDelegate : class { }