-`CoreStoreError.MappingModelNotFoundError`
+`CoreStoreError.MappingModelNotFoundError`:
+These are all implemented with `CustomDebugStringConvertible.debugDescription`, so they work with lldb's `po` command as well.
## Observing changes and notifications (unavailable on macOS)
CoreStore provides type-safe wrappers for observing managed objects:
@@ -1285,12 +1287,139 @@ let person2 = self.monitor[1, 2]
```
## Objective-C support
- | Swift | Objective-C |
|---|---|
+try CoreStore.addStorageAndWait(SQLiteStore)
+ |
+
+NSError *error
+[CSCoreStore addSQLiteStorageAndWait:[CSSQLiteStore new] error:&error]
+ |
+
+CoreStore.beginAsynchronous { (transaction) in
+ // ...
+ transaction.commit { (result) in
+ switch result {
+ case .Success(let hasChanges): print(hasChanges)
+ case .Failure(let error): print(error)
+ }
+ }
+}
+ |
+
+[CSCoreStore beginAsynchronous:^(CSAsynchronousDataTransaction *transaction) {
+ // ...
+ [transaction commitWithCompletion:^(CSSaveResult *result) {
+ if (result.isSuccess) {
+ NSLog(@"hasChanges: %d", result.hasChanges);
+ }
+ else if (result.isFailure) {
+ NSLog(@"error: %@", result.error);
+ }
+ }];
+}];
+ |
+
# Roadmap
-- Support iCloud stores
-- CoreSpotlight auto-indexing (experimental)
+- Built-in "singleton objects" support
+- Built-in "readonly" stores
+- CoreSpotlight auto-indexing (experimenting, still some roadblocks ahead)
+- Synching
# Installation
@@ -1311,8 +1440,8 @@ This installs CoreStore as a framework. Declare `import CoreStore` in your swift
### Install with Carthage
In your `Cartfile`, add
```
-github "JohnEstropia/CoreStore" >= 1.6.0
-github "JohnEstropia/GCDKit" >= 1.2.2
+github "JohnEstropia/CoreStore" >= 2.0.0
+github "JohnEstropia/GCDKit" >= 1.2.5
```
and run
```
@@ -1332,6 +1461,18 @@ Drag and drop **CoreStore.xcodeproj** to your project.
Add all *.swift* files to your project.
+### Objective-C support
+
+To use the Objective-C syntax sugars, import *CoreStoreBridge.h* in your *.m* source files.
+
+For projects that support iOS 7 (and thus cannot build CoreStore as a module), you will need to add
+```
+SWIFT_OBJC_INTERFACE_HEADER_NAME=$(SWIFT_OBJC_INTERFACE_HEADER_NAME)
+```
+to your target's `GCC_PREPROCESSOR_DEFINITIONS` build setting:
+
+
+
# Changesets
### Upgrading from 1.x.x to 2.x.x