Skip to content

datinc/ContextObserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WIP: ContextObserver

CI Status Version License Platform

ContextObserver is used to help observer NSManagedObjects. ContextObserver will let you observer:

  1. Any changes on an NSManagedObject (including relationships)
  2. A keypath of an NSManagedObject

Observer any changes on a NSManagedObject

let observer = ContextObserver(context: mainContext)
observer.add(observer: self, for: managedObject) { (change) in
    ...
})

...
observer.remove(self)

Observer keypath of an NSManagedObject

let observer = ContextObserver(context: mainContext)
observer.add(observer: self, for: managedObject, keyPath: someKeyPath) { (change) in
...
})

...
observer.remove(self)

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

ContextObserver is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'ContextObserver'

Author

datinc

License

ContextObserver is available under the MIT license. See the LICENSE file for more info.

About

Swift Core Data Observation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published