added demo for observing changes to a single managed object

This commit is contained in:
John Rommel Estropia
2015-05-07 00:30:45 +09:00
parent 8d42a4a885
commit eade08d0cd
12 changed files with 439 additions and 136 deletions

View File

@@ -46,6 +46,11 @@ public extension DataStack {
public func observeObjectList<T: NSManagedObject>(from: From<T>, _ groupBy: GroupBy? = nil, _ queryClauses: FetchClause...) -> ManagedObjectListController<T> {
return self.observeObjectList(from, groupBy, queryClauses)
}
public func observeObjectList<T: NSManagedObject>(from: From<T>, _ groupBy: GroupBy? = nil, _ queryClauses: [FetchClause]) -> ManagedObjectListController<T> {
HardcoreData.assert(GCDQueue.Main.isCurrentExecutionContext(), "Attempted to observe objects from \(typeName(self)) outside the main queue.")
// TODO: sectionNameKeyPath and cacheResults