From a48f16aa8c0963db4c69bbe094daccbd5235e367 Mon Sep 17 00:00:00 2001 From: John Estropia Date: Wed, 19 Dec 2018 16:27:05 +0900 Subject: [PATCH] add Jazzy docs --- .gitignore | 1 + .jazzy.yaml | 15 + CoreStore.podspec | 3 +- CoreStore.xcodeproj/project.pbxproj | 2 + README.md | 2 +- docs/Classes.html | 3126 +++++++++++ docs/Classes/AsynchronousDataTransaction.html | 1270 +++++ .../AsynchronousDataTransaction/Result.html | 869 +++ docs/Classes/BaseDataTransaction.html | 3794 +++++++++++++ .../CSAsynchronousDataTransaction.html | 1212 ++++ docs/Classes/CSBaseDataTransaction.html | 2150 +++++++ docs/Classes/CSCoreStore.html | 2721 +++++++++ docs/Classes/CSDataStack.html | 2847 ++++++++++ docs/Classes/CSError.html | 891 +++ docs/Classes/CSFrom.html | 1025 ++++ docs/Classes/CSGroupBy.html | 916 +++ docs/Classes/CSInMemoryStore.html | 1027 ++++ docs/Classes/CSInto.html | 963 ++++ docs/Classes/CSListMonitor.html | 2152 +++++++ docs/Classes/CSMigrationResult.html | 1128 ++++ docs/Classes/CSMigrationType.html | 997 ++++ docs/Classes/CSObjectMonitor.html | 949 ++++ docs/Classes/CSOrderBy.html | 924 +++ docs/Classes/CSSQLiteStore.html | 1250 +++++ docs/Classes/CSSectionBy.html | 909 +++ docs/Classes/CSSelect.html | 1200 ++++ docs/Classes/CSSelectTerm.html | 1225 ++++ docs/Classes/CSSetupResult.html | 1065 ++++ .../Classes/CSSynchronousDataTransaction.html | 1203 ++++ docs/Classes/CSTweak.html | 937 ++++ docs/Classes/CSUnsafeDataModelSchema.html | 981 ++++ docs/Classes/CSUnsafeDataTransaction.html | 1267 +++++ docs/Classes/CSWhere.html | 1102 ++++ docs/Classes/CSXcodeDataModelSchema.html | 981 ++++ docs/Classes/CoreStoreObject.html | 1283 +++++ docs/Classes/CoreStoreObjectObjectDiff.html | 896 +++ docs/Classes/CoreStoreObjectOrderedDiff.html | 923 +++ .../CoreStoreObjectTransformableDiff.html | 896 +++ .../Classes/CoreStoreObjectUnorderedDiff.html | 896 +++ docs/Classes/CoreStoreObjectValueDiff.html | 896 +++ docs/Classes/CoreStoreSchema.html | 1111 ++++ docs/Classes/CustomSchemaMappingProvider.html | 1140 ++++ .../CustomMapping.html | 1055 ++++ .../UnsafeDestinationObject.html | 869 +++ .../UnsafeSourceObject.html | 869 +++ docs/Classes/DataStack.html | 4996 +++++++++++++++++ docs/Classes/DefaultLogger.html | 1172 ++++ docs/Classes/DynamicEntity.html | 1024 ++++ docs/Classes/Entity.html | 1060 ++++ docs/Classes/ICloudStore.html | 1309 +++++ docs/Classes/InMemoryStore.html | 1081 ++++ .../InferredSchemaMappingProvider.html | 895 +++ docs/Classes/ListMonitor.html | 2571 +++++++++ docs/Classes/ObjectMonitor.html | 1099 ++++ docs/Classes/SQLiteStore.html | 1524 +++++ docs/Classes/SchemaHistory.html | 1153 ++++ docs/Classes/SynchronousDataTransaction.html | 1231 ++++ docs/Classes/UnsafeDataModelSchema.html | 987 ++++ docs/Classes/UnsafeDataTransaction.html | 2281 ++++++++ docs/Classes/UserInfo.html | 926 +++ docs/Classes/XcodeDataModelSchema.html | 1127 ++++ docs/Classes/XcodeSchemaMappingProvider.html | 1050 ++++ docs/Enums.html | 1357 +++++ docs/Enums/CSErrorCode.html | 988 ++++ docs/Enums/CSLocalStorageOptions.html | 902 +++ docs/Enums/CoreStore.html | 4269 ++++++++++++++ docs/Enums/CoreStoreError.html | 1278 +++++ docs/Enums/CoreStoreErrorCode.html | 1004 ++++ docs/Enums/MigrationResult.html | 953 ++++ docs/Enums/MigrationType.html | 1152 ++++ docs/Enums/RelationshipContainer.html | 944 ++++ .../RelationshipContainer/ToManyOrdered.html | 1920 +++++++ .../ToManyUnordered.html | 1889 +++++++ docs/Enums/RelationshipContainer/ToOne.html | 1710 ++++++ docs/Enums/SelectTerm.html | 3285 +++++++++++ docs/Enums/SetupResult.html | 1007 ++++ docs/Enums/TransformableContainer.html | 890 +++ .../TransformableContainer/Optional.html | 1257 +++++ .../TransformableContainer/Required.html | 1227 ++++ docs/Enums/ValueContainer.html | 890 +++ docs/Enums/ValueContainer/Optional.html | 1647 ++++++ docs/Enums/ValueContainer/Required.html | 1556 +++++ docs/Extensions.html | 1881 +++++++ docs/Extensions/Bool.html | 893 +++ docs/Extensions/CGFloat.html | 893 +++ docs/Extensions/Data.html | 893 +++ docs/Extensions/Date.html | 893 +++ docs/Extensions/Double.html | 893 +++ docs/Extensions/Float.html | 893 +++ docs/Extensions/Int.html | 893 +++ docs/Extensions/Int16.html | 893 +++ docs/Extensions/Int32.html | 893 +++ docs/Extensions/Int64.html | 893 +++ docs/Extensions/Int8.html | 893 +++ docs/Extensions/KeyPath.html | 865 +++ docs/Extensions/KeyPathString.html | 845 +++ docs/Extensions/NSData.html | 896 +++ docs/Extensions/NSDate.html | 896 +++ docs/Extensions/NSManagedObject.html | 1675 ++++++ docs/Extensions/NSManagedObjectContext.html | 1517 +++++ docs/Extensions/NSManagedObjectID.html | 896 +++ docs/Extensions/NSNull.html | 896 +++ docs/Extensions/NSNumber.html | 896 +++ docs/Extensions/NSString.html | 896 +++ docs/Extensions/NSURL.html | 896 +++ docs/Extensions/NSUUID.html | 896 +++ docs/Extensions/Progress.html | 885 +++ docs/Extensions/RawRepresentable.html | 843 +++ docs/Extensions/Sequence.html | 872 +++ docs/Extensions/String.html | 893 +++ docs/Extensions/URL.html | 893 +++ docs/Extensions/UUID.html | 894 +++ docs/Functions.html | 2204 ++++++++ docs/Global Variables.html | 817 +++ docs/Protocols.html | 2785 +++++++++ docs/Protocols/AnyWhereClause.html | 861 +++ docs/Protocols/CSDynamicSchema.html | 850 +++ docs/Protocols/CSListObjectObserver.html | 1096 ++++ docs/Protocols/CSListObserver.html | 988 ++++ docs/Protocols/CSListSectionObserver.html | 943 ++++ docs/Protocols/CSLocalStorage.html | 906 +++ docs/Protocols/CSObjectObserver.html | 987 ++++ docs/Protocols/CSStorageInterface.html | 878 +++ docs/Protocols/CloudStorage.html | 896 +++ docs/Protocols/CoreStoreLogger.html | 1164 ++++ .../CoreStoreObjectKeyValueObservation.html | 817 +++ docs/Protocols/CoreStoreObjectiveCType.html | 869 +++ docs/Protocols/CoreStoreSwiftType.html | 842 +++ docs/Protocols/DynamicKeyPath.html | 842 +++ docs/Protocols/DynamicObject.html | 1121 ++++ docs/Protocols/DynamicSchema.html | 898 +++ docs/Protocols/FetchChainableBuilderType.html | 869 +++ docs/Protocols/FetchableSource.html | 1915 +++++++ docs/Protocols/GroupByClause.html | 842 +++ docs/Protocols/ICloudStoreObserver.html | 1316 +++++ docs/Protocols/ImportableObject.html | 961 ++++ docs/Protocols/ImportableUniqueObject.html | 1210 ++++ docs/Protocols/ListObjectObserver.html | 1119 ++++ docs/Protocols/ListObserver.html | 1031 ++++ docs/Protocols/ListSectionObserver.html | 952 ++++ docs/Protocols/LocalStorage.html | 950 ++++ docs/Protocols/ObjectObserver.html | 1029 ++++ docs/Protocols/OrderByClause.html | 842 +++ docs/Protocols/QueryChainableBuilderType.html | 923 +++ docs/Protocols/QueryableAttributeType.html | 927 +++ docs/Protocols/QueryableSource.html | 1244 ++++ docs/Protocols/SchemaMappingProvider.html | 815 +++ docs/Protocols/SectionMonitorBuilderType.html | 897 +++ docs/Protocols/SelectClause.html | 869 +++ docs/Protocols/StorageInterface.html | 934 +++ docs/Protocols/WhereClauseType.html | 966 ++++ docs/Structs.html | 1556 +++++ docs/Structs/CloudStorageOptions.html | 1017 ++++ docs/Structs/FetchChainBuilder.html | 1276 +++++ docs/Structs/From.html | 2873 ++++++++++ docs/Structs/GroupBy.html | 1345 +++++ docs/Structs/Into.html | 1145 ++++ docs/Structs/LocalStorageOptions.html | 1044 ++++ docs/Structs/MigrationChain.html | 1253 +++++ docs/Structs/OrderBy.html | 1278 +++++ docs/Structs/OrderBy/SortKey.html | 1206 ++++ docs/Structs/PartialObject.html | 1307 +++++ docs/Structs/QueryChainBuilder.html | 1812 ++++++ docs/Structs/SectionBy.html | 1508 +++++ docs/Structs/SectionMonitorChainBuilder.html | 1339 +++++ docs/Structs/Select.html | 1422 +++++ docs/Structs/Tweak.html | 949 ++++ docs/Structs/VersionLock.html | 1093 ++++ docs/Structs/Where.html | 2911 ++++++++++ docs/Typealiases.html | 1006 ++++ docs/badge.svg | 28 + docs/css/highlight.css | 200 + docs/css/jazzy.css | 368 ++ .../CoreStore.docset/Contents/Info.plist | 20 + .../Contents/Resources/Documents/Classes.html | 3126 +++++++++++ .../Classes/AsynchronousDataTransaction.html | 1270 +++++ .../AsynchronousDataTransaction/Result.html | 869 +++ .../Classes/BaseDataTransaction.html | 3794 +++++++++++++ .../CSAsynchronousDataTransaction.html | 1212 ++++ .../Classes/CSBaseDataTransaction.html | 2150 +++++++ .../Documents/Classes/CSCoreStore.html | 2721 +++++++++ .../Documents/Classes/CSDataStack.html | 2847 ++++++++++ .../Resources/Documents/Classes/CSError.html | 891 +++ .../Resources/Documents/Classes/CSFrom.html | 1025 ++++ .../Documents/Classes/CSGroupBy.html | 916 +++ .../Documents/Classes/CSInMemoryStore.html | 1027 ++++ .../Resources/Documents/Classes/CSInto.html | 963 ++++ .../Documents/Classes/CSListMonitor.html | 2152 +++++++ .../Documents/Classes/CSMigrationResult.html | 1128 ++++ .../Documents/Classes/CSMigrationType.html | 997 ++++ .../Documents/Classes/CSObjectMonitor.html | 949 ++++ .../Documents/Classes/CSOrderBy.html | 924 +++ .../Documents/Classes/CSSQLiteStore.html | 1250 +++++ .../Documents/Classes/CSSectionBy.html | 909 +++ .../Resources/Documents/Classes/CSSelect.html | 1200 ++++ .../Documents/Classes/CSSelectTerm.html | 1225 ++++ .../Documents/Classes/CSSetupResult.html | 1065 ++++ .../Classes/CSSynchronousDataTransaction.html | 1203 ++++ .../Resources/Documents/Classes/CSTweak.html | 937 ++++ .../Classes/CSUnsafeDataModelSchema.html | 981 ++++ .../Classes/CSUnsafeDataTransaction.html | 1267 +++++ .../Resources/Documents/Classes/CSWhere.html | 1102 ++++ .../Classes/CSXcodeDataModelSchema.html | 981 ++++ .../Documents/Classes/CoreStoreObject.html | 1283 +++++ .../Classes/CoreStoreObjectObjectDiff.html | 896 +++ .../Classes/CoreStoreObjectOrderedDiff.html | 923 +++ .../CoreStoreObjectTransformableDiff.html | 896 +++ .../Classes/CoreStoreObjectUnorderedDiff.html | 896 +++ .../Classes/CoreStoreObjectValueDiff.html | 896 +++ .../Documents/Classes/CoreStoreSchema.html | 1111 ++++ .../Classes/CustomSchemaMappingProvider.html | 1140 ++++ .../CustomMapping.html | 1055 ++++ .../UnsafeDestinationObject.html | 869 +++ .../UnsafeSourceObject.html | 869 +++ .../Documents/Classes/DataStack.html | 4996 +++++++++++++++++ .../Documents/Classes/DefaultLogger.html | 1172 ++++ .../Documents/Classes/DynamicEntity.html | 1024 ++++ .../Resources/Documents/Classes/Entity.html | 1060 ++++ .../Documents/Classes/ICloudStore.html | 1309 +++++ .../Documents/Classes/InMemoryStore.html | 1081 ++++ .../InferredSchemaMappingProvider.html | 895 +++ .../Documents/Classes/ListMonitor.html | 2571 +++++++++ .../Documents/Classes/ObjectMonitor.html | 1099 ++++ .../Documents/Classes/SQLiteStore.html | 1524 +++++ .../Documents/Classes/SchemaHistory.html | 1153 ++++ .../Classes/SynchronousDataTransaction.html | 1231 ++++ .../Classes/UnsafeDataModelSchema.html | 987 ++++ .../Classes/UnsafeDataTransaction.html | 2281 ++++++++ .../Resources/Documents/Classes/UserInfo.html | 926 +++ .../Classes/XcodeDataModelSchema.html | 1127 ++++ .../Classes/XcodeSchemaMappingProvider.html | 1050 ++++ .../Contents/Resources/Documents/Enums.html | 1357 +++++ .../Documents/Enums/CSErrorCode.html | 988 ++++ .../Enums/CSLocalStorageOptions.html | 902 +++ .../Resources/Documents/Enums/CoreStore.html | 4269 ++++++++++++++ .../Documents/Enums/CoreStoreError.html | 1278 +++++ .../Documents/Enums/CoreStoreErrorCode.html | 1004 ++++ .../Documents/Enums/MigrationResult.html | 953 ++++ .../Documents/Enums/MigrationType.html | 1152 ++++ .../Enums/RelationshipContainer.html | 944 ++++ .../RelationshipContainer/ToManyOrdered.html | 1920 +++++++ .../ToManyUnordered.html | 1889 +++++++ .../Enums/RelationshipContainer/ToOne.html | 1710 ++++++ .../Resources/Documents/Enums/SelectTerm.html | 3285 +++++++++++ .../Documents/Enums/SetupResult.html | 1007 ++++ .../Enums/TransformableContainer.html | 890 +++ .../TransformableContainer/Optional.html | 1257 +++++ .../TransformableContainer/Required.html | 1227 ++++ .../Documents/Enums/ValueContainer.html | 890 +++ .../Enums/ValueContainer/Optional.html | 1647 ++++++ .../Enums/ValueContainer/Required.html | 1556 +++++ .../Resources/Documents/Extensions.html | 1881 +++++++ .../Resources/Documents/Extensions/Bool.html | 893 +++ .../Documents/Extensions/CGFloat.html | 893 +++ .../Resources/Documents/Extensions/Data.html | 893 +++ .../Resources/Documents/Extensions/Date.html | 893 +++ .../Documents/Extensions/Double.html | 893 +++ .../Resources/Documents/Extensions/Float.html | 893 +++ .../Resources/Documents/Extensions/Int.html | 893 +++ .../Resources/Documents/Extensions/Int16.html | 893 +++ .../Resources/Documents/Extensions/Int32.html | 893 +++ .../Resources/Documents/Extensions/Int64.html | 893 +++ .../Resources/Documents/Extensions/Int8.html | 893 +++ .../Documents/Extensions/KeyPath.html | 865 +++ .../Documents/Extensions/KeyPathString.html | 845 +++ .../Documents/Extensions/NSData.html | 896 +++ .../Documents/Extensions/NSDate.html | 896 +++ .../Documents/Extensions/NSManagedObject.html | 1675 ++++++ .../Extensions/NSManagedObjectContext.html | 1517 +++++ .../Extensions/NSManagedObjectID.html | 896 +++ .../Documents/Extensions/NSNull.html | 896 +++ .../Documents/Extensions/NSNumber.html | 896 +++ .../Documents/Extensions/NSString.html | 896 +++ .../Resources/Documents/Extensions/NSURL.html | 896 +++ .../Documents/Extensions/NSUUID.html | 896 +++ .../Documents/Extensions/Progress.html | 885 +++ .../Extensions/RawRepresentable.html | 843 +++ .../Documents/Extensions/Sequence.html | 872 +++ .../Documents/Extensions/String.html | 893 +++ .../Resources/Documents/Extensions/URL.html | 893 +++ .../Resources/Documents/Extensions/UUID.html | 894 +++ .../Resources/Documents/Functions.html | 2204 ++++++++ .../Resources/Documents/Global Variables.html | 817 +++ .../Resources/Documents/Protocols.html | 2785 +++++++++ .../Documents/Protocols/AnyWhereClause.html | 861 +++ .../Documents/Protocols/CSDynamicSchema.html | 850 +++ .../Protocols/CSListObjectObserver.html | 1096 ++++ .../Documents/Protocols/CSListObserver.html | 988 ++++ .../Protocols/CSListSectionObserver.html | 943 ++++ .../Documents/Protocols/CSLocalStorage.html | 906 +++ .../Documents/Protocols/CSObjectObserver.html | 987 ++++ .../Protocols/CSStorageInterface.html | 878 +++ .../Documents/Protocols/CloudStorage.html | 896 +++ .../Documents/Protocols/CoreStoreLogger.html | 1164 ++++ .../CoreStoreObjectKeyValueObservation.html | 817 +++ .../Protocols/CoreStoreObjectiveCType.html | 869 +++ .../Protocols/CoreStoreSwiftType.html | 842 +++ .../Documents/Protocols/DynamicKeyPath.html | 842 +++ .../Documents/Protocols/DynamicObject.html | 1121 ++++ .../Documents/Protocols/DynamicSchema.html | 898 +++ .../Protocols/FetchChainableBuilderType.html | 869 +++ .../Documents/Protocols/FetchableSource.html | 1915 +++++++ .../Documents/Protocols/GroupByClause.html | 842 +++ .../Protocols/ICloudStoreObserver.html | 1316 +++++ .../Documents/Protocols/ImportableObject.html | 961 ++++ .../Protocols/ImportableUniqueObject.html | 1210 ++++ .../Protocols/ListObjectObserver.html | 1119 ++++ .../Documents/Protocols/ListObserver.html | 1031 ++++ .../Protocols/ListSectionObserver.html | 952 ++++ .../Documents/Protocols/LocalStorage.html | 950 ++++ .../Documents/Protocols/ObjectObserver.html | 1029 ++++ .../Documents/Protocols/OrderByClause.html | 842 +++ .../Protocols/QueryChainableBuilderType.html | 923 +++ .../Protocols/QueryableAttributeType.html | 927 +++ .../Documents/Protocols/QueryableSource.html | 1244 ++++ .../Protocols/SchemaMappingProvider.html | 815 +++ .../Protocols/SectionMonitorBuilderType.html | 897 +++ .../Documents/Protocols/SelectClause.html | 869 +++ .../Documents/Protocols/StorageInterface.html | 934 +++ .../Documents/Protocols/WhereClauseType.html | 966 ++++ .../Contents/Resources/Documents/Structs.html | 1556 +++++ .../Structs/CloudStorageOptions.html | 1017 ++++ .../Documents/Structs/FetchChainBuilder.html | 1276 +++++ .../Resources/Documents/Structs/From.html | 2873 ++++++++++ .../Resources/Documents/Structs/GroupBy.html | 1345 +++++ .../Resources/Documents/Structs/Into.html | 1145 ++++ .../Structs/LocalStorageOptions.html | 1044 ++++ .../Documents/Structs/MigrationChain.html | 1253 +++++ .../Resources/Documents/Structs/OrderBy.html | 1278 +++++ .../Documents/Structs/OrderBy/SortKey.html | 1206 ++++ .../Documents/Structs/PartialObject.html | 1307 +++++ .../Documents/Structs/QueryChainBuilder.html | 1812 ++++++ .../Documents/Structs/SectionBy.html | 1508 +++++ .../Structs/SectionMonitorChainBuilder.html | 1339 +++++ .../Resources/Documents/Structs/Select.html | 1422 +++++ .../Resources/Documents/Structs/Tweak.html | 949 ++++ .../Documents/Structs/VersionLock.html | 1093 ++++ .../Resources/Documents/Structs/Where.html | 2911 ++++++++++ .../Resources/Documents/Typealiases.html | 1006 ++++ .../Resources/Documents/css/highlight.css | 200 + .../Resources/Documents/css/jazzy.css | 368 ++ .../Resources/Documents/img/carat.png | Bin 0 -> 274 bytes .../Contents/Resources/Documents/img/dash.png | Bin 0 -> 1338 bytes .../Contents/Resources/Documents/img/gh.png | Bin 0 -> 1571 bytes .../Resources/Documents/img/spinner.gif | Bin 0 -> 1849 bytes .../Contents/Resources/Documents/index.html | 2712 +++++++++ .../Contents/Resources/Documents/js/jazzy.js | 43 + .../Resources/Documents/js/jazzy.search.js | 62 + .../Resources/Documents/js/jquery.min.js | 4 + .../Resources/Documents/js/lunr.min.js | 6 + .../Documents/js/typeahead.jquery.js | 1538 +++++ .../Contents/Resources/Documents/search.json | 1 + .../Contents/Resources/docSet.dsidx | Bin 0 -> 520192 bytes docs/docsets/CoreStore.tgz | Bin 0 -> 1097408 bytes docs/img/carat.png | Bin 0 -> 274 bytes docs/img/dash.png | Bin 0 -> 1338 bytes docs/img/gh.png | Bin 0 -> 1571 bytes docs/img/spinner.gif | Bin 0 -> 1849 bytes docs/index.html | 2712 +++++++++ docs/js/jazzy.js | 43 + docs/js/jazzy.search.js | 62 + docs/js/jquery.min.js | 4 + docs/js/lunr.min.js | 6 + docs/js/typeahead.jquery.js | 1538 +++++ docs/search.json | 1 + docs/undocumented.json | 1748 ++++++ 366 files changed, 422275 insertions(+), 2 deletions(-) create mode 100644 .jazzy.yaml create mode 100644 docs/Classes.html create mode 100644 docs/Classes/AsynchronousDataTransaction.html create mode 100644 docs/Classes/AsynchronousDataTransaction/Result.html create mode 100644 docs/Classes/BaseDataTransaction.html create mode 100644 docs/Classes/CSAsynchronousDataTransaction.html create mode 100644 docs/Classes/CSBaseDataTransaction.html create mode 100644 docs/Classes/CSCoreStore.html create mode 100644 docs/Classes/CSDataStack.html create mode 100644 docs/Classes/CSError.html create mode 100644 docs/Classes/CSFrom.html create mode 100644 docs/Classes/CSGroupBy.html create mode 100644 docs/Classes/CSInMemoryStore.html create mode 100644 docs/Classes/CSInto.html create mode 100644 docs/Classes/CSListMonitor.html create mode 100644 docs/Classes/CSMigrationResult.html create mode 100644 docs/Classes/CSMigrationType.html create mode 100644 docs/Classes/CSObjectMonitor.html create mode 100644 docs/Classes/CSOrderBy.html create mode 100644 docs/Classes/CSSQLiteStore.html create mode 100644 docs/Classes/CSSectionBy.html create mode 100644 docs/Classes/CSSelect.html create mode 100644 docs/Classes/CSSelectTerm.html create mode 100644 docs/Classes/CSSetupResult.html create mode 100644 docs/Classes/CSSynchronousDataTransaction.html create mode 100644 docs/Classes/CSTweak.html create mode 100644 docs/Classes/CSUnsafeDataModelSchema.html create mode 100644 docs/Classes/CSUnsafeDataTransaction.html create mode 100644 docs/Classes/CSWhere.html create mode 100644 docs/Classes/CSXcodeDataModelSchema.html create mode 100644 docs/Classes/CoreStoreObject.html create mode 100644 docs/Classes/CoreStoreObjectObjectDiff.html create mode 100644 docs/Classes/CoreStoreObjectOrderedDiff.html create mode 100644 docs/Classes/CoreStoreObjectTransformableDiff.html create mode 100644 docs/Classes/CoreStoreObjectUnorderedDiff.html create mode 100644 docs/Classes/CoreStoreObjectValueDiff.html create mode 100644 docs/Classes/CoreStoreSchema.html create mode 100644 docs/Classes/CustomSchemaMappingProvider.html create mode 100644 docs/Classes/CustomSchemaMappingProvider/CustomMapping.html create mode 100644 docs/Classes/CustomSchemaMappingProvider/UnsafeDestinationObject.html create mode 100644 docs/Classes/CustomSchemaMappingProvider/UnsafeSourceObject.html create mode 100644 docs/Classes/DataStack.html create mode 100644 docs/Classes/DefaultLogger.html create mode 100644 docs/Classes/DynamicEntity.html create mode 100644 docs/Classes/Entity.html create mode 100644 docs/Classes/ICloudStore.html create mode 100644 docs/Classes/InMemoryStore.html create mode 100644 docs/Classes/InferredSchemaMappingProvider.html create mode 100644 docs/Classes/ListMonitor.html create mode 100644 docs/Classes/ObjectMonitor.html create mode 100644 docs/Classes/SQLiteStore.html create mode 100644 docs/Classes/SchemaHistory.html create mode 100644 docs/Classes/SynchronousDataTransaction.html create mode 100644 docs/Classes/UnsafeDataModelSchema.html create mode 100644 docs/Classes/UnsafeDataTransaction.html create mode 100644 docs/Classes/UserInfo.html create mode 100644 docs/Classes/XcodeDataModelSchema.html create mode 100644 docs/Classes/XcodeSchemaMappingProvider.html create mode 100644 docs/Enums.html create mode 100644 docs/Enums/CSErrorCode.html create mode 100644 docs/Enums/CSLocalStorageOptions.html create mode 100644 docs/Enums/CoreStore.html create mode 100644 docs/Enums/CoreStoreError.html create mode 100644 docs/Enums/CoreStoreErrorCode.html create mode 100644 docs/Enums/MigrationResult.html create mode 100644 docs/Enums/MigrationType.html create mode 100644 docs/Enums/RelationshipContainer.html create mode 100644 docs/Enums/RelationshipContainer/ToManyOrdered.html create mode 100644 docs/Enums/RelationshipContainer/ToManyUnordered.html create mode 100644 docs/Enums/RelationshipContainer/ToOne.html create mode 100644 docs/Enums/SelectTerm.html create mode 100644 docs/Enums/SetupResult.html create mode 100644 docs/Enums/TransformableContainer.html create mode 100644 docs/Enums/TransformableContainer/Optional.html create mode 100644 docs/Enums/TransformableContainer/Required.html create mode 100644 docs/Enums/ValueContainer.html create mode 100644 docs/Enums/ValueContainer/Optional.html create mode 100644 docs/Enums/ValueContainer/Required.html create mode 100644 docs/Extensions.html create mode 100644 docs/Extensions/Bool.html create mode 100644 docs/Extensions/CGFloat.html create mode 100644 docs/Extensions/Data.html create mode 100644 docs/Extensions/Date.html create mode 100644 docs/Extensions/Double.html create mode 100644 docs/Extensions/Float.html create mode 100644 docs/Extensions/Int.html create mode 100644 docs/Extensions/Int16.html create mode 100644 docs/Extensions/Int32.html create mode 100644 docs/Extensions/Int64.html create mode 100644 docs/Extensions/Int8.html create mode 100644 docs/Extensions/KeyPath.html create mode 100644 docs/Extensions/KeyPathString.html create mode 100644 docs/Extensions/NSData.html create mode 100644 docs/Extensions/NSDate.html create mode 100644 docs/Extensions/NSManagedObject.html create mode 100644 docs/Extensions/NSManagedObjectContext.html create mode 100644 docs/Extensions/NSManagedObjectID.html create mode 100644 docs/Extensions/NSNull.html create mode 100644 docs/Extensions/NSNumber.html create mode 100644 docs/Extensions/NSString.html create mode 100644 docs/Extensions/NSURL.html create mode 100644 docs/Extensions/NSUUID.html create mode 100644 docs/Extensions/Progress.html create mode 100644 docs/Extensions/RawRepresentable.html create mode 100644 docs/Extensions/Sequence.html create mode 100644 docs/Extensions/String.html create mode 100644 docs/Extensions/URL.html create mode 100644 docs/Extensions/UUID.html create mode 100644 docs/Functions.html create mode 100644 docs/Global Variables.html create mode 100644 docs/Protocols.html create mode 100644 docs/Protocols/AnyWhereClause.html create mode 100644 docs/Protocols/CSDynamicSchema.html create mode 100644 docs/Protocols/CSListObjectObserver.html create mode 100644 docs/Protocols/CSListObserver.html create mode 100644 docs/Protocols/CSListSectionObserver.html create mode 100644 docs/Protocols/CSLocalStorage.html create mode 100644 docs/Protocols/CSObjectObserver.html create mode 100644 docs/Protocols/CSStorageInterface.html create mode 100644 docs/Protocols/CloudStorage.html create mode 100644 docs/Protocols/CoreStoreLogger.html create mode 100644 docs/Protocols/CoreStoreObjectKeyValueObservation.html create mode 100644 docs/Protocols/CoreStoreObjectiveCType.html create mode 100644 docs/Protocols/CoreStoreSwiftType.html create mode 100644 docs/Protocols/DynamicKeyPath.html create mode 100644 docs/Protocols/DynamicObject.html create mode 100644 docs/Protocols/DynamicSchema.html create mode 100644 docs/Protocols/FetchChainableBuilderType.html create mode 100644 docs/Protocols/FetchableSource.html create mode 100644 docs/Protocols/GroupByClause.html create mode 100644 docs/Protocols/ICloudStoreObserver.html create mode 100644 docs/Protocols/ImportableObject.html create mode 100644 docs/Protocols/ImportableUniqueObject.html create mode 100644 docs/Protocols/ListObjectObserver.html create mode 100644 docs/Protocols/ListObserver.html create mode 100644 docs/Protocols/ListSectionObserver.html create mode 100644 docs/Protocols/LocalStorage.html create mode 100644 docs/Protocols/ObjectObserver.html create mode 100644 docs/Protocols/OrderByClause.html create mode 100644 docs/Protocols/QueryChainableBuilderType.html create mode 100644 docs/Protocols/QueryableAttributeType.html create mode 100644 docs/Protocols/QueryableSource.html create mode 100644 docs/Protocols/SchemaMappingProvider.html create mode 100644 docs/Protocols/SectionMonitorBuilderType.html create mode 100644 docs/Protocols/SelectClause.html create mode 100644 docs/Protocols/StorageInterface.html create mode 100644 docs/Protocols/WhereClauseType.html create mode 100644 docs/Structs.html create mode 100644 docs/Structs/CloudStorageOptions.html create mode 100644 docs/Structs/FetchChainBuilder.html create mode 100644 docs/Structs/From.html create mode 100644 docs/Structs/GroupBy.html create mode 100644 docs/Structs/Into.html create mode 100644 docs/Structs/LocalStorageOptions.html create mode 100644 docs/Structs/MigrationChain.html create mode 100644 docs/Structs/OrderBy.html create mode 100644 docs/Structs/OrderBy/SortKey.html create mode 100644 docs/Structs/PartialObject.html create mode 100644 docs/Structs/QueryChainBuilder.html create mode 100644 docs/Structs/SectionBy.html create mode 100644 docs/Structs/SectionMonitorChainBuilder.html create mode 100644 docs/Structs/Select.html create mode 100644 docs/Structs/Tweak.html create mode 100644 docs/Structs/VersionLock.html create mode 100644 docs/Structs/Where.html create mode 100644 docs/Typealiases.html create mode 100644 docs/badge.svg create mode 100644 docs/css/highlight.css create mode 100644 docs/css/jazzy.css create mode 100644 docs/docsets/CoreStore.docset/Contents/Info.plist create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/AsynchronousDataTransaction.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/AsynchronousDataTransaction/Result.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/BaseDataTransaction.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSAsynchronousDataTransaction.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSBaseDataTransaction.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSCoreStore.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSDataStack.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSError.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSFrom.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSGroupBy.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSInMemoryStore.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSInto.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSListMonitor.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSMigrationResult.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSMigrationType.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSObjectMonitor.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSOrderBy.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSSQLiteStore.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSSectionBy.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSSelect.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSSelectTerm.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSSetupResult.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSSynchronousDataTransaction.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSTweak.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSUnsafeDataModelSchema.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSUnsafeDataTransaction.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSWhere.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSXcodeDataModelSchema.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CoreStoreObject.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CoreStoreObjectObjectDiff.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CoreStoreObjectOrderedDiff.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CoreStoreObjectTransformableDiff.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CoreStoreObjectUnorderedDiff.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CoreStoreObjectValueDiff.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CoreStoreSchema.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CustomSchemaMappingProvider.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CustomSchemaMappingProvider/CustomMapping.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CustomSchemaMappingProvider/UnsafeDestinationObject.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CustomSchemaMappingProvider/UnsafeSourceObject.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/DataStack.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/DefaultLogger.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/DynamicEntity.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/Entity.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/ICloudStore.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/InMemoryStore.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/InferredSchemaMappingProvider.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/ListMonitor.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/ObjectMonitor.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/SQLiteStore.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/SchemaHistory.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/SynchronousDataTransaction.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/UnsafeDataModelSchema.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/UnsafeDataTransaction.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/UserInfo.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/XcodeDataModelSchema.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/XcodeSchemaMappingProvider.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/CSErrorCode.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/CSLocalStorageOptions.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/CoreStore.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/CoreStoreError.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/CoreStoreErrorCode.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/MigrationResult.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/MigrationType.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/RelationshipContainer.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/RelationshipContainer/ToManyOrdered.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/RelationshipContainer/ToManyUnordered.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/RelationshipContainer/ToOne.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/SelectTerm.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/SetupResult.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/TransformableContainer.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/TransformableContainer/Optional.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/TransformableContainer/Required.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/ValueContainer.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/ValueContainer/Optional.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/ValueContainer/Required.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Bool.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/CGFloat.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Data.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Date.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Double.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Float.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Int.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Int16.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Int32.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Int64.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Int8.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/KeyPath.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/KeyPathString.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSData.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSDate.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSManagedObject.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSManagedObjectContext.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSManagedObjectID.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSNull.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSNumber.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSString.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSURL.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSUUID.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Progress.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/RawRepresentable.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Sequence.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/String.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/URL.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/UUID.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Functions.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Global Variables.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/AnyWhereClause.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CSDynamicSchema.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CSListObjectObserver.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CSListObserver.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CSListSectionObserver.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CSLocalStorage.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CSObjectObserver.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CSStorageInterface.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CloudStorage.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CoreStoreLogger.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CoreStoreObjectKeyValueObservation.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CoreStoreObjectiveCType.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CoreStoreSwiftType.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/DynamicKeyPath.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/DynamicObject.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/DynamicSchema.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/FetchChainableBuilderType.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/FetchableSource.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/GroupByClause.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/ICloudStoreObserver.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/ImportableObject.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/ImportableUniqueObject.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/ListObjectObserver.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/ListObserver.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/ListSectionObserver.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/LocalStorage.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/ObjectObserver.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/OrderByClause.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/QueryChainableBuilderType.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/QueryableAttributeType.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/QueryableSource.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/SchemaMappingProvider.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/SectionMonitorBuilderType.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/SelectClause.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/StorageInterface.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/WhereClauseType.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/CloudStorageOptions.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/FetchChainBuilder.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/From.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/GroupBy.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/Into.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/LocalStorageOptions.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/MigrationChain.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/OrderBy.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/OrderBy/SortKey.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/PartialObject.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/QueryChainBuilder.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/SectionBy.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/SectionMonitorChainBuilder.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/Select.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/Tweak.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/VersionLock.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/Where.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/Typealiases.html create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/css/highlight.css create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/css/jazzy.css create mode 100755 docs/docsets/CoreStore.docset/Contents/Resources/Documents/img/carat.png create mode 100755 docs/docsets/CoreStore.docset/Contents/Resources/Documents/img/dash.png create mode 100755 docs/docsets/CoreStore.docset/Contents/Resources/Documents/img/gh.png create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/img/spinner.gif create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/index.html create mode 100755 docs/docsets/CoreStore.docset/Contents/Resources/Documents/js/jazzy.js create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/js/jazzy.search.js create mode 100755 docs/docsets/CoreStore.docset/Contents/Resources/Documents/js/jquery.min.js create mode 100755 docs/docsets/CoreStore.docset/Contents/Resources/Documents/js/lunr.min.js create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/js/typeahead.jquery.js create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/Documents/search.json create mode 100644 docs/docsets/CoreStore.docset/Contents/Resources/docSet.dsidx create mode 100644 docs/docsets/CoreStore.tgz create mode 100755 docs/img/carat.png create mode 100755 docs/img/dash.png create mode 100755 docs/img/gh.png create mode 100644 docs/img/spinner.gif create mode 100644 docs/index.html create mode 100755 docs/js/jazzy.js create mode 100644 docs/js/jazzy.search.js create mode 100755 docs/js/jquery.min.js create mode 100755 docs/js/lunr.min.js create mode 100644 docs/js/typeahead.jquery.js create mode 100644 docs/search.json create mode 100644 docs/undocumented.json diff --git a/.gitignore b/.gitignore index 3750064..7581d82 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ CoreStore.xcworkspace/xcuserdata .DS_Store DerivedData *.orig +build diff --git a/.jazzy.yaml b/.jazzy.yaml new file mode 100644 index 0000000..6fb261e --- /dev/null +++ b/.jazzy.yaml @@ -0,0 +1,15 @@ +author: John Estropia +author_url: https://github.com/JohnEstropia +github_url: https://github.com/JohnEstropia/CoreStore +module: CoreStore +readme: README.md +include: Sources/* +output: docs +theme: fullwidth +clean: true +skip_undocumented: true +xcodebuild_arguments: +- -sdk +- iphonesimulator +- -scheme +- CoreStore iOS diff --git a/CoreStore.podspec b/CoreStore.podspec index 5cec51b..ab5c033 100644 --- a/CoreStore.podspec +++ b/CoreStore.podspec @@ -3,8 +3,9 @@ Pod::Spec.new do |s| s.version = "5.4.0" s.swift_version = "4.2" s.license = "MIT" - s.summary = "Unleashing the real power of Core Data with the elegance and safety of Swift" s.homepage = "https://github.com/JohnEstropia/CoreStore" + s.documentation_url = "https://JohnEstropia.github.io/CoreStore" + s.summary = "Unleashing the real power of Core Data with the elegance and safety of Swift" s.author = { "John Rommel Estropia" => "rommel.estropia@gmail.com" } s.source = { :git => "https://github.com/JohnEstropia/CoreStore.git", :tag => s.version.to_s } diff --git a/CoreStore.xcodeproj/project.pbxproj b/CoreStore.xcodeproj/project.pbxproj index e1916c1..9811c98 100644 --- a/CoreStore.xcodeproj/project.pbxproj +++ b/CoreStore.xcodeproj/project.pbxproj @@ -787,6 +787,7 @@ B5220E071D0C5F8D009BC71E /* ObjectObserverTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ObjectObserverTests.swift; sourceTree = ""; }; B5220E0B1D0D0D19009BC71E /* ImportTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImportTests.swift; sourceTree = ""; }; B5220E0F1D0DA6AB009BC71E /* ListObserverTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListObserverTests.swift; sourceTree = ""; }; + B524E78721CA20AC00BEB794 /* .jazzy.yaml */ = {isa = PBXFileReference; lastKnownFileType = text; path = .jazzy.yaml; sourceTree = SOURCE_ROOT; }; B525576B1CFAF18F00E51965 /* IntoTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IntoTests.swift; sourceTree = ""; }; B525576F1D02561A00E51965 /* SelectTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SelectTests.swift; sourceTree = ""; }; B52557731D02791400E51965 /* WhereTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WhereTests.swift; sourceTree = ""; }; @@ -1089,6 +1090,7 @@ B5BDC91A1C202269008147CD /* Cartfile */, B5D2D5A91F7558CB00A4DE67 /* .cocoapods.yml */, B5BDC9271C2024F2008147CD /* .travis.yml */, + B524E78721CA20AC00BEB794 /* .jazzy.yaml */, B5AD60CD1C90141E00F2B2E8 /* Package.swift */, ); name = "Supporting Files"; diff --git a/README.md b/README.md index 850c227..6f1a5ed 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ CoreStore was (and is) heavily shaped by real-world needs of developing data-dep - [Starting migrations](#starting-migrations) - [Progressive migrations](#progressive-migrations) - [Forecasting migrations](#forecasting-migrations) - - [Custom migratoins](#custom-migrations) + - [Custom migrations](#custom-migrations) - [Saving and processing transactions](#saving-and-processing-transactions) - [Transaction types](#transaction-types) - [Asynchronous transactions](#asynchronous-transactions) diff --git a/docs/Classes.html b/docs/Classes.html new file mode 100644 index 0000000..a817650 --- /dev/null +++ b/docs/Classes.html @@ -0,0 +1,3126 @@ + + + + Classes Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Classes

+

The following classes are available globally.

+ +
+
+ +
+
+
+ + +
+
+ +
    +
  • +
    + + + + BaseDataTransaction + +
    +
    +
    +
    +
    +
    +

    The BaseDataTransaction is an abstract interface for NSManagedObject creates, updates, and deletes. All BaseDataTransaction subclasses manage a private NSManagedObjectContext which are direct children of the NSPersistentStoreCoordinator‘s root NSManagedObjectContext. This means that all updates are saved first to the persistent store, and then propagated up to the read-only NSManagedObjectContext.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class BaseDataTransaction
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ + +
+
+ +
    +
  • +
    + + + + CSCoreStore + +
    +
    +
    +
    +
    +
    +

    The CSCoreStore serves as the Objective-C bridging type for CoreStore.

    +
    +

    See also

    + CoreStore + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public final class CSCoreStore : NSObject
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + DataStack + +
    +
    +
    +
    +
    +
    +

    The DataStack encapsulates the data model for the Core Data stack. Each DataStack can have multiple data stores, usually specified as a Configuration in the model editor. Behind the scenes, the DataStack manages its own NSPersistentStoreCoordinator, a root NSManagedObjectContext for disk saves, and a shared NSManagedObjectContext designed as a read-only model interface for NSManagedObjects.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class DataStack : Equatable
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+
+ + + +

CSFrom

+
+
+
    +
  • +
    + + + + CSFrom + +
    +
    +
    +
    +
    +
    +

    The CSFrom serves as the Objective-C bridging type for From.

    +
    +

    See also

    + From + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public final class CSFrom : NSObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CSGroupBy + +
    +
    +
    +
    +
    +
    +

    The CSGroupBy serves as the Objective-C bridging type for GroupBy.

    +
    +

    See also

    + GroupBy + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public final class CSGroupBy : NSObject, CSQueryClause
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + InMemoryStore + +
    +
    +
    +
    +
    +
    +

    A storage interface that is backed only in memory.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class InMemoryStore : StorageInterface
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

CSInto

+
+
+
    +
  • +
    + + + + CSInto + +
    +
    +
    +
    +
    +
    +

    The CSInto serves as the Objective-C bridging type for Into<T>.

    +
    +

    See also

    + Into + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public final class CSInto : NSObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CSListMonitor + +
    +
    +
    +
    +
    +
    +

    The CSListMonitor serves as the Objective-C bridging type for ListMonitor<T>.

    +
    +

    See also

    + ListMonitor + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +@objc
    +public final class CSListMonitor : NSObject
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ + +
+
+ +
    +
  • +
    + + + + CSObjectMonitor + +
    +
    +
    +
    +
    +
    +

    The CSObjectMonitor serves as the Objective-C bridging type for ObjectMonitor<T>.

    +
    +

    See also

    + ObjectMonitor + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +@objc
    +public final class CSObjectMonitor : NSObject
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ + +
+
+ +
    +
  • +
    + + + + SQLiteStore + +
    +
    +
    +
    +
    +
    +

    A storage interface that is backed by an SQLite database.

    +
    +

    Warning

    + The default SQLite file location for the LegacySQLiteStore and SQLiteStore are different. If the app was depending on CoreStore’s default directories prior to 2.0.0, make sure to use the SQLiteStore.legacy(...) factory methods to create the SQLiteStore instead of using initializers directly. + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class SQLiteStore : LocalStorage
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CSSectionBy + +
    +
    +
    +
    +
    +
    +

    The CSSectionBy serves as the Objective-C bridging type for SectionBy.

    +
    +

    See also

    + SectionBy + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +@objc
    +public final class CSSectionBy : NSObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CSSelectTerm + +
    +
    +
    +
    +
    +
    +

    The CSSelectTerm serves as the Objective-C bridging type for SelectTerm.

    +
    +

    See also

    + SelectTerm + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public final class CSSelectTerm : NSObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CSSelect + +
    +
    +
    +
    +
    +
    +

    The CSSelect serves as the Objective-C bridging type for Select.

    +
    +

    See also

    + Select + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public final class CSSelect : NSObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CSSetupResult + +
    +
    +
    +
    +
    +
    +

    The CSSetupResult serves as the Objective-C bridging type for SetupResult.

    +
    +

    See also

    + SetupResult + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public final class CSSetupResult : NSObject
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    The SynchronousDataTransaction provides an interface for DynamicObject creates, updates, and deletes. A transaction object should typically be only used from within a transaction block initiated from DataStack.beginSynchronous(_:), or from CoreStore.beginSynchronous(_:).

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class SynchronousDataTransaction : BaseDataTransaction
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ + +
+
+ +
    +
  • +
    + + + + UnsafeDataModelSchema + +
    +
    +
    +
    +
    +
    +

    The UnsafeDataModelSchema describes models loaded directly from an existing NSManagedObjectModel. It is not advisable to continue using this model as its metadata are not available to CoreStore.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class UnsafeDataModelSchema : DynamicSchema
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + UnsafeDataTransaction + +
    +
    +
    +
    +
    +
    +

    The UnsafeDataTransaction provides an interface for non-contiguous NSManagedObject or CoreStoreObject creates, updates, and deletes. This is useful for making temporary changes, such as partially filled forms. An unsafe transaction object should typically be only used from the main queue.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class UnsafeDataTransaction : BaseDataTransaction
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ + +
+
+ +
    +
  • +
    + + + + XcodeDataModelSchema + +
    +
    +
    +
    +
    +
    +

    The XcodeDataModelSchema describes a model version declared in a single *.xcdatamodeld file.

    +
    CoreStore.defaultStack = DataStack(
    +    XcodeDataModelSchema(modelName: "MyAppV1", bundle: .main)
    +)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class XcodeDataModelSchema : DynamicSchema
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CoreStoreObject + +
    +
    +
    +
    +
    +
    +

    The CoreStoreObject is an abstract class for creating CoreStore-managed objects that are more type-safe and more convenient than NSManagedObject subclasses. The model entities for CoreStoreObject subclasses are inferred from the Swift declaration themselves; no .xcdatamodeld files are needed. To declare persisted attributes and relationships for the CoreStoreObject subclass, declare properties of type Value.Required<T>, Value.Optional<T> for values, or Relationship.ToOne<T>, Relationship.ToManyOrdered<T>, Relationship.ToManyUnordered<T> for relationships.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let nickname = Value.Optional<String>("nickname")
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +
    +class Person: CoreStoreObject {
    +    let name = Value.Required<String>("name", initial: "")
    +    let pet = Relationship.ToOne<Animal>("pet", inverse: { $0.master })
    +}
    +
    + +

    CoreStoreObject entities for a model version should be added to CoreStoreSchema instance.

    +
    CoreStore.defaultStack = DataStack(
    +    CoreStoreSchema(
    +        modelVersion: "V1",
    +        entities: [
    +            Entity<Animal>("Animal"),
    +            Entity<Person>("Person")
    +        ]
    +    )
    +)
    +
    +
    +

    See also

    + CoreStoreSchema + +
    +
    +

    See also

    + CoreStoreObject.Value + +
    +
    +

    See also

    + CoreStoreObject.Relationship + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class CoreStoreObject : DynamicObject, Hashable
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CoreStoreSchema + +
    +
    +
    +
    +
    +
    +

    The CoreStoreSchema describes models written for CoreStoreObject Swift class declarations for a particular model version. CoreStoreObject entities for a model version should be added to CoreStoreSchema instance.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let nickname = Value.Optional<String>("nickname")
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +
    +class Person: CoreStoreObject {
    +    let name = Value.Required<String>("name", initial: "")
    +    let pet = Relationship.ToOne<Animal>("pet", inverse: { $0.master })
    +}
    +
    +CoreStore.defaultStack = DataStack(
    +    CoreStoreSchema(
    +        modelVersion: "V1",
    +        entities: [
    +            Entity<Animal>("Animal"),
    +            Entity<Person>("Person")
    +        ],
    +        versionLock: [
    +            "Animal": [0x2698c812ebbc3b97, 0x751e3fa3f04cf9, 0x51fd460d3babc82, 0x92b4ba735b5a3053],
    +            "Person": [0xae4060a59f990ef0, 0x8ac83a6e1411c130, 0xa29fea58e2e38ab6, 0x2071bb7e33d77887]
    +        ]
    +    )
    +)
    +
    +
    +

    See also

    + CoreStoreObject + +
    +
    +

    See also

    + Entity + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class CoreStoreSchema : DynamicSchema
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Entity

+
+
+
    +
  • +
    + + + + Entity + +
    +
    +
    +
    +
    +
    +

    The Entity<O> contains NSEntityDescription metadata for CoreStoreObject subclasses. Pass the Entity instances to CoreStoreSchema initializer.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let nickname = Value.Optional<String>("nickname")
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +
    +class Person: CoreStoreObject {
    +    let name = Value.Required<String>("name", initial: "")
    +    let pet = Relationship.ToOne<Animal>("pet", inverse: { $0.master })
    +}
    +
    +CoreStore.defaultStack = DataStack(
    +    CoreStoreSchema(
    +        modelVersion: "V1",
    +        entities: [
    +            Entity<Animal>("Animal"),
    +            Entity<Person>("Person")
    +        ]
    +    )
    +)
    +
    +
    +

    See also

    + CoreStoreSchema + +
    +
    +

    See also

    + CoreStoreObject + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class Entity<O> : DynamicEntity where O : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ICloudStore + +
    +
    +
    +
    +
    +
    +

    A storage interface backed by an SQLite database managed by iCloud.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, message: "Please see the release notes and Core Data documentation.")
    +public final class ICloudStore : CloudStorage
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ListMonitor + +
    +
    +
    +
    +
    +
    +

    The ListMonitor monitors changes to a list of DynamicObject instances. Observers that implement the ListObserver protocol may then register themselves to the ListMonitor‘s addObserver(_:) method:

    +
    let monitor = CoreStore.monitorList(
    +    From<Person>(),
    +    Where("title", isEqualTo: "Engineer"),
    +    OrderBy(.ascending("lastName"))
    +)
    +monitor.addObserver(self)
    +
    + +

    The ListMonitor instance needs to be held on (retained) for as long as the list needs to be observed. +Observers registered via addObserver(_:) are not retained. ListMonitor only keeps a weak reference to all observers, thus keeping itself free from retain-cycles.

    + +

    Lists created with monitorList(...) keep a single-section list of objects, where each object can be accessed by index:

    +
    let firstPerson: MyPersonEntity = monitor[0]
    +
    + +

    Accessing the list with an index above the valid range will raise an exception.

    + +

    Creating a sectioned-list is also possible with the monitorSectionedList(...) method:

    +
    let monitor = CoreStore.monitorSectionedList(
    +    From<Person>(),
    +    SectionBy("age") { "Age \($0)" },
    +    Where("title", isEqualTo: "Engineer"),
    +    OrderBy(.ascending("lastName"))
    +)
    +monitor.addObserver(self)
    +
    + +

    Objects from ListMonitors created this way can be accessed either by an IndexPath or a tuple:

    +
    let indexPath = IndexPath(forItem: 3, inSection: 2)
    +let person1 = monitor[indexPath]
    +let person2 = monitor[2, 3]
    +
    + +

    In the example above, both person1 and person2 will contain the object at section=2, index=3.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public final class ListMonitor<D> : Hashable where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ObjectMonitor + +
    +
    +
    +
    +
    +
    +

    The ObjectMonitor monitors changes to a single DynamicObject instance. Observers that implement the ObjectObserver protocol may then register themselves to the ObjectMonitor‘s addObserver(_:) method:

    +
    let monitor = CoreStore.monitorObject(object)
    +monitor.addObserver(self)
    +
    + +

    The created ObjectMonitor instance needs to be held on (retained) for as long as the object needs to be observed.

    + +

    Observers registered via addObserver(_:) are not retained. ObjectMonitor only keeps a weak reference to all observers, thus keeping itself free from retain-cycles.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public final class ObjectMonitor<D> : Equatable where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + SchemaHistory + +
    +
    +
    +
    +
    +
    +

    The SchemaHistory encapsulates multiple DynamicSchema across multiple model versions. It contains all model history and is used by the DataStack to

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class SchemaHistory : ExpressibleByArrayLiteral
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    The object containing the changeset for an observed RelationshipContainer.Ordered property.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class CoreStoreObjectOrderedDiff<D> where D : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ + +
+
+ +
    +
  • +
    + + + + DynamicEntity + +
    +
    +
    +
    +
    +
    +

    Use concrete instances of Entity<O> in API that accept DynamicEntity arguments.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class DynamicEntity : Hashable
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    A SchemaMappingProvider that tries to infer model migration between two DynamicSchema versions by searching all xcmappingmodels from Bundle.allBundles or by relying on lightweight migration if possible. Throws an error if lightweight migration is impossible for the two DynamicSchema. This mapping is automatically used as a fallback mapping provider, even if no mapping providers are explicitly declared in the StorageInterface.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class InferredSchemaMappingProvider : Hashable, SchemaMappingProvider
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + UserInfo + +
    +
    +
    +
    +
    +
    +

    The UserInfo class is provided by several CoreStore types such as DataStack, ListMonitor, ObjectMonitor and transactions to allow external libraries or user apps to store their own custom data.

    +
    enum Static {
    +    static var myDataKey: Void?
    +}
    +CoreStore.defaultStack.userInfo[&Static.myDataKey] = myObject
    +
    +
    +

    Important

    + Do not use this class to store thread-sensitive data. + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class UserInfo
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    A SchemaMappingProvider that tries to infer model migration between two DynamicSchema versions by loading an xcmappingmodel file from the specified Bundle. Throws CoreStoreError.mappingModelNotFound if the xcmappingmodel file cannot be found, or if the xcmappingmodel doesn’t resolve the source and destination DynamicSchema.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class XcodeSchemaMappingProvider : Hashable, SchemaMappingProvider
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/AsynchronousDataTransaction.html b/docs/Classes/AsynchronousDataTransaction.html new file mode 100644 index 0000000..cef69ee --- /dev/null +++ b/docs/Classes/AsynchronousDataTransaction.html @@ -0,0 +1,1270 @@ + + + + AsynchronousDataTransaction Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

AsynchronousDataTransaction

+
+
+
public final class AsynchronousDataTransaction : BaseDataTransaction
+ +
+
+

The AsynchronousDataTransaction provides an interface for DynamicObject creates, updates, and deletes. A transaction object should typically be only used from within a transaction block initiated from DataStack.perform(asynchronous:...), or from CoreStore.perform(synchronous:...).

+ +
+
+ +
+
+
+
    +
  • +
    + + + + cancel() + +
    +
    +
    +
    +
    +
    +

    Cancels a transaction by throwing CoreStoreError.userCancelled.

    +
    try transaction.cancel()
    +
    +
    +

    Important

    + Never use try? or try! on a cancel() call. Always use try. Using try? will swallow the cancellation and the transaction will proceed to commit as normal. Using try! will crash the app as cancel() will always throw an error. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cancel() throws -> Never
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Result

+
+
+
    +
  • +
    + + + + Result + +
    +
    +
    +
    +
    +
    +

    The Result contains the success or failure information for a completed transaction

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum Result<T>
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + create(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a new NSManagedObject or CoreStoreObject with the specified entity type.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override func create<D>(_ into: Into<D>) -> D where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + into + + +
    +

    the Into clause indicating the destination NSManagedObject or CoreStoreObject entity type and the destination configuration

    +
    +
    +
    +
    +

    Return Value

    +

    a new NSManagedObject or CoreStoreObject instance of the specified entity type.

    +
    +
    +
    +
  • +
  • +
    + + + + edit(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an editable proxy of a specified NSManagedObject or CoreStoreObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override func edit<D>(_ object: D?) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject or CoreStoreObject to be edited

    +
    +
    +
    +
    +

    Return Value

    +

    an editable proxy for the specified NSManagedObject or CoreStoreObject.

    +
    +
    +
    +
  • +
  • +
    + + + + edit(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an editable proxy of the object with the specified NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override func edit<D>(_ into: Into<D>, _ objectID: NSManagedObjectID) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + into + + +
    +

    an Into clause specifying the entity type

    +
    +
    + + objectID + + +
    +

    the NSManagedObjectID for the object to be edited

    +
    +
    +
    +
    +

    Return Value

    +

    an editable proxy for the specified NSManagedObject or CoreStoreObject.

    +
    +
    +
    +
  • +
  • +
    + + + + delete(_:) + +
    +
    +
    +
    +
    +
    +

    Deletes a specified NSManagedObject or CoreStoreObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override func delete<D>(_ object: D?) where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject or CoreStoreObject to be deleted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + delete(_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Deletes the specified DynamicObjects.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override func delete<D>(_ object1: D?, _ object2: D?, _ objects: D?...) where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + object1 + + +
    +

    the DynamicObject to be deleted

    +
    +
    + + object2 + + +
    +

    another DynamicObject to be deleted

    +
    +
    + + objects + + +
    +

    other DynamicObjects to be deleted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + delete(_:) + +
    +
    +
    +
    +
    +
    +

    Deletes the specified DynamicObjects.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override func delete<S>(_ objects: S) where S : Sequence, S.Element : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objects + + +
    +

    the DynamicObjects to be deleted

    +
    +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/AsynchronousDataTransaction/Result.html b/docs/Classes/AsynchronousDataTransaction/Result.html new file mode 100644 index 0000000..861bb0d --- /dev/null +++ b/docs/Classes/AsynchronousDataTransaction/Result.html @@ -0,0 +1,869 @@ + + + + Result Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Result

+
+
+
public enum Result<T>
+ +
+
+

The Result contains the success or failure information for a completed transaction

+ +
+
+ +
+
+
+
    +
  • +
    + + + + success(userInfo:) + +
    +
    +
    +
    +
    +
    +

    Result<T>.success indicates that the transaction succeeded, either because the save succeeded or because there were no changes to save. The associated userInfo is the value returned from the transaction closure.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case success(userInfo: T)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + failure(error:) + +
    +
    +
    +
    +
    +
    +

    Result<T>.failure indicates that the transaction either failed or was cancelled. The associated object for this value is a CoreStoreError enum value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case failure(error: CoreStoreError)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + boolValue + +
    +
    +
    +
    +
    +
    +

    Returns true if the result indicates .success, false if the result is .failure.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var boolValue: Bool { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/BaseDataTransaction.html b/docs/Classes/BaseDataTransaction.html new file mode 100644 index 0000000..6ee9b4f --- /dev/null +++ b/docs/Classes/BaseDataTransaction.html @@ -0,0 +1,3794 @@ + + + + BaseDataTransaction Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

BaseDataTransaction

+
+
+
public class BaseDataTransaction
+ +
+
+

The BaseDataTransaction is an abstract interface for NSManagedObject creates, updates, and deletes. All BaseDataTransaction subclasses manage a private NSManagedObjectContext which are direct children of the NSPersistentStoreCoordinator‘s root NSManagedObjectContext. This means that all updates are saved first to the persistent store, and then propagated up to the read-only NSManagedObjectContext.

+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + hasChanges + +
    +
    +
    +
    +
    +
    +

    Indicates if the transaction has pending changes

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var hasChanges: Bool { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + create(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a new NSManagedObject or CoreStoreObject with the specified entity type.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func create<D>(_ into: Into<D>) -> D where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + into + + +
    +

    the Into clause indicating the destination NSManagedObject or CoreStoreObject entity type and the destination configuration

    +
    +
    +
    +
    +

    Return Value

    +

    a new NSManagedObject or CoreStoreObject instance of the specified entity type.

    +
    +
    +
    +
  • +
  • +
    + + + + edit(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an editable proxy of a specified NSManagedObject or CoreStoreObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func edit<D>(_ object: D?) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject or CoreStoreObject type to be edited

    +
    +
    +
    +
    +

    Return Value

    +

    an editable proxy for the specified NSManagedObject or CoreStoreObject.

    +
    +
    +
    +
  • +
  • +
    + + + + edit(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an editable proxy of the object with the specified NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func edit<D>(_ into: Into<D>, _ objectID: NSManagedObjectID) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + into + + +
    +

    an Into clause specifying the entity type

    +
    +
    + + objectID + + +
    +

    the NSManagedObjectID for the object to be edited

    +
    +
    +
    +
    +

    Return Value

    +

    an editable proxy for the specified NSManagedObject or CoreStoreObject.

    +
    +
    +
    +
  • +
  • +
    + + + + delete(_:) + +
    +
    +
    +
    +
    +
    +

    Deletes a specified NSManagedObject or CoreStoreObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func delete<D>(_ object: D?) where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject or CoreStoreObject to be deleted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + delete(_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Deletes the specified NSManagedObjects or CoreStoreObjects.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func delete<D>(_ object1: D?, _ object2: D?, _ objects: D?...) where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + object1 + + +
    +

    the NSManagedObject or CoreStoreObject to be deleted

    +
    +
    + + object2 + + +
    +

    another NSManagedObject or CoreStoreObject to be deleted

    +
    +
    + + objects + + +
    +

    other NSManagedObjects or CoreStoreObjects to be deleted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + delete(_:) + +
    +
    +
    +
    +
    +
    +

    Deletes the specified NSManagedObjects or CoreStoreObjects.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func delete<S>(_ objects: S) where S : Sequence, S.Element : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objects + + +
    +

    the NSManagedObjects or CoreStoreObjects to be deleted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Refreshes all registered objects NSManagedObjects in the transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func refreshAndMergeAllObjects()
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + insertedObjects(_:) + +
    +
    +
    +
    +
    +
    +

    Returns all pending DynamicObjects of the specified type that were inserted to the transaction. This method should not be called after the commit() method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func insertedObjects<D>(_ entity: D.Type) -> Set<D> where D : DynamicObject, D : Hashable
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the DynamicObject subclass to filter

    +
    +
    +
    +
    +

    Return Value

    +

    a Set of pending DynamicObjects of the specified type that were inserted to the transaction.

    +
    +
    +
    +
  • +
  • +
    + + + + insertedObjectIDs() + +
    +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjectIDs that were inserted to the transaction. This method should not be called after the commit() method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func insertedObjectIDs() -> Set<NSManagedObjectID>
    + +
    +
    +
    +

    Return Value

    +

    a Set of pending NSManagedObjectIDs that were inserted to the transaction.

    +
    +
    +
    +
  • +
  • +
    + + + + insertedObjectIDs(_:) + +
    +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjectIDs of the specified type that were inserted to the transaction. This method should not be called after the commit() method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func insertedObjectIDs<D>(_ entity: D.Type) -> Set<NSManagedObjectID> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the DynamicObject subclass to filter

    +
    +
    +
    +
    +

    Return Value

    +

    a Set of pending NSManagedObjectIDs of the specified type that were inserted to the transaction.

    +
    +
    +
    +
  • +
  • +
    + + + + updatedObjects(_:) + +
    +
    +
    +
    +
    +
    +

    Returns all pending DynamicObjects of the specified type that were updated in the transaction. This method should not be called after the commit() method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func updatedObjects<D>(_ entity: D.Type) -> Set<D> where D : DynamicObject, D : Hashable
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the DynamicObject subclass to filter

    +
    +
    +
    +
    +

    Return Value

    +

    a Set of pending DynamicObjects of the specified type that were updated in the transaction.

    +
    +
    +
    +
  • +
  • +
    + + + + updatedObjectIDs() + +
    +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjectIDs that were updated in the transaction. This method should not be called after the commit() method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func updatedObjectIDs() -> Set<NSManagedObjectID>
    + +
    +
    +
    +

    Return Value

    +

    a Set of pending NSManagedObjectIDs that were updated in the transaction.

    +
    +
    +
    +
  • +
  • +
    + + + + updatedObjectIDs(_:) + +
    +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjectIDs of the specified type that were updated in the transaction. This method should not be called after the commit() method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func updatedObjectIDs<D>(_ entity: D.Type) -> Set<NSManagedObjectID> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the DynamicObject subclass to filter

    +
    +
    +
    +
    +

    Return Value

    +

    a Set of pending NSManagedObjectIDs of the specified type that were updated in the transaction.

    +
    +
    +
    +
  • +
  • +
    + + + + deletedObjects(_:) + +
    +
    +
    +
    +
    +
    +

    Returns all pending DynamicObjects of the specified type that were deleted from the transaction. This method should not be called after the commit() method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func deletedObjects<D>(_ entity: D.Type) -> Set<D> where D : DynamicObject, D : Hashable
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the DynamicObject subclass to filter

    +
    +
    +
    +
    +

    Return Value

    +

    a Set of pending DynamicObjects of the specified type that were deleted from the transaction.

    +
    +
    +
    +
  • +
  • +
    + + + + deletedObjectIDs() + +
    +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjectIDs of the specified type that were deleted from the transaction. This method should not be called after the commit() method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func deletedObjectIDs() -> Set<NSManagedObjectID>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the DynamicObject subclass to filter

    +
    +
    +
    +
    +

    Return Value

    +

    a Set of pending NSManagedObjectIDs of the specified type that were deleted from the transaction.

    +
    +
    +
    +
  • +
  • +
    + + + + deletedObjectIDs(_:) + +
    +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjectIDs of the specified type that were deleted from the transaction. This method should not be called after the commit() method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func deletedObjectIDs<D>(_ entity: D.Type) -> Set<NSManagedObjectID> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the DynamicObject subclass to filter

    +
    +
    +
    +
    +

    Return Value

    +

    a Set of pending NSManagedObjectIDs of the specified type that were deleted from the transaction.

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + userInfo + +
    +
    +
    +
    +
    +
    +

    Allow external libraries to store custom data in the transaction. App code should rarely have a need for this.

    +
    enum Static {
    +   static var myDataKey: Void?
    +}
    +transaction.userInfo[&Static.myDataKey] = myObject
    +
    +
    +

    Important

    + Do not use this method to store thread-sensitive data. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let userInfo: UserInfo
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Creates an ImportableObject by importing from the specified import source.

    +
    +

    Throws

    + an Error thrown from any of the ImportableObject methods + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func importObject<D: ImportableObject>(
    +    _ into: Into<D>,
    +    source: D.ImportSource) throws -> D?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + into + + +
    +

    an Into clause specifying the entity type

    +
    +
    + + source + + +
    +

    the object to import values from

    +
    +
    +
    +
    +

    Return Value

    +

    the created ImportableObject instance, or nil if the import was ignored

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Updates an existing ImportableObject by importing values from the specified import source.

    +
    +

    Throws

    + an Error thrown from any of the ImportableObject methods + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func importObject<D: ImportableObject>(
    +    _ object: D,
    +    source: D.ImportSource) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + object + + +
    +

    the NSManagedObject to update

    +
    +
    + + source + + +
    +

    the object to import values from

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates multiple ImportableObjects by importing from the specified array of import sources.

    +
    +

    Throws

    + an Error thrown from any of the ImportableObject methods + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func importObjects<D: ImportableObject, S: Sequence>(
    +    _ into: Into<D>,
    +    sourceArray: S) throws -> [D] where S.Iterator.Element == D.ImportSource
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + into + + +
    +

    an Into clause specifying the entity type

    +
    +
    + + sourceArray + + +
    +

    the array of objects to import values from

    +
    +
    +
    +
    +

    Return Value

    +

    the array of created ImportableObject instances

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Updates an existing ImportableUniqueObject or creates a new instance by importing from the specified import source.

    +
    +

    Throws

    + an Error thrown from any of the ImportableUniqueObject methods + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func importUniqueObject<D: ImportableUniqueObject>(
    +    _ into: Into<D>,
    +    source: D.ImportSource) throws -> D?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + into + + +
    +

    an Into clause specifying the entity type

    +
    +
    + + source + + +
    +

    the object to import values from

    +
    +
    +
    +
    +

    Return Value

    +

    the created/updated ImportableUniqueObject instance, or nil if the import was ignored

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Updates existing ImportableUniqueObjects or creates them by importing from the specified array of import sources. +ImportableUniqueObject methods are called on the objects in the same order as they are in the sourceArray, and are returned in an array with that same order.

    +
    +

    Warning

    +

    If sourceArray contains multiple import sources with same ID, only the last ImportSource of the duplicates will be imported.

    + +
    +
    +

    Throws

    +

    an Error thrown from any of the ImportableUniqueObject methods

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func importUniqueObjects<D: ImportableUniqueObject, S: Sequence>(
    +    _ into: Into<D>,
    +    sourceArray: S,
    +    preProcess: @escaping (_ mapping: [D.UniqueIDType: D.ImportSource]) throws -> [D.UniqueIDType: D.ImportSource] = { $0 }) throws -> [D] where S.Iterator.Element == D.ImportSource
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + into + + +
    +

    an Into clause specifying the entity type

    +
    +
    + + sourceArray + + +
    +

    the array of objects to import values from

    +
    +
    + + preProcess + + +
    +

    a closure that lets the caller tweak the internal UniqueIDType-to-ImportSource mapping to be used for importing. Callers can remove from/add to/update mapping and return the updated array from the closure.

    +
    +
    +
    +
    +

    Return Value

    +

    the array of created/updated ImportableUniqueObject instances

    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the DynamicObject instance in the transaction’s context from a reference created from a transaction or from a different managed object context.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchExisting<D>(_ object: D) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    a reference to the object created/fetched outside the transaction

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject instance if the object exists in the transaction, or nil if not found.

    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the DynamicObject instance in the transaction’s context from an NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchExisting<D>(_ objectID: NSManagedObjectID) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objectID + + +
    +

    the NSManagedObjectID for the object

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject instance if the object exists in the transaction, or nil if not found.

    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the DynamicObject instances in the transaction’s context from references created from a transaction or from a different managed object context.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchExisting<D, S>(_ objects: S) -> [D] where D : DynamicObject, D == S.Element, S : Sequence
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objects + + +
    +

    an array of DynamicObjects created/fetched outside the transaction

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject array for objects that exists in the transaction

    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the DynamicObject instances in the transaction’s context from a list of NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchExisting<D, S>(_ objectIDs: S) -> [D] where D : DynamicObject, S : Sequence, S.Element == NSManagedObjectID
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objectIDs + + +
    +

    the NSManagedObjectID array for the objects

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject array for objects that exists in the transaction

    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the first DynamicObject instance that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchOne<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the first DynamicObject instance that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the first DynamicObject instance that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchOne<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the first DynamicObject instance that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the first DynamicObject instance that satisfies the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let youngestTeen = transaction.fetchOne(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchOne<B>(_ clauseChain: B) -> B.ObjectType? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the first DynamicObject instance that satisfies the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches all DynamicObject instances that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchAll<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> [D]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    all DynamicObject instances that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches all DynamicObject instances that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchAll<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> [D]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    all DynamicObject instances that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches all DynamicObject instances that satisfy the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let people = transaction.fetchAll(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchAll<B>(_ clauseChain: B) -> [B.ObjectType]? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    all DynamicObject instances that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the number of DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchCount<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> Int? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the number DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the number of DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchCount<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> Int? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the number DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the number of DynamicObjects that satisfy the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let numberOfAdults = transaction.fetchCount(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchCount<B>(_ clauseChain: B) -> Int? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the number DynamicObjects that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> NSManagedObjectID? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> NSManagedObjectID? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let youngestTeenID = transaction.fetchObjectID(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchObjectID<B>(_ clauseChain: B) -> NSManagedObjectID? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> [NSManagedObjectID]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> [NSManagedObjectID]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let idsOfAdults = transaction.fetchObjectIDs(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchObjectIDs<B>(_ clauseChain: B) -> [NSManagedObjectID]? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + queryValue(_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Queries aggregate values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queryValue<D, U>(_ from: From<D>, _ selectClause: Select<D, U>, _ queryClauses: QueryClause...) -> U? where D : DynamicObject, U : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • +
    + + + + queryValue(_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Queries aggregate values or aggregates as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queryValue<D, U>(_ from: From<D>, _ selectClause: Select<D, U>, _ queryClauses: [QueryClause]) -> U? where D : DynamicObject, U : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • +
    + + + + queryValue(_:) + +
    +
    +
    +
    +
    +
    +

    Queries a property value or aggregate as specified by the QueryChainableBuilderType built from a chain of clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    +
    let averageAdultAge = transaction.queryValue(
    +    From<MyPersonEntity>()
    +        .select(Int.self, .average(\.age))
    +        .where(\.age > 18)
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queryValue<B>(_ clauseChain: B) -> B.ResultType? where B : QueryChainableBuilderType, B.ResultType : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a QueryChainableBuilderType indicating the property/aggregate to fetch and the series of queries for the request.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query as specified by the QueryChainableBuilderType

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Queries a dictionary of attribute values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queryAttributes<D>(_ from: From<D>, _ selectClause: Select<D, NSDictionary>, _ queryClauses: QueryClause...) -> [[String : Any]]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Queries a dictionary of attribute values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queryAttributes<D>(_ from: From<D>, _ selectClause: Select<D, NSDictionary>, _ queryClauses: [QueryClause]) -> [[String : Any]]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • +
    + + + + queryAttributes(_:) + +
    +
    +
    +
    +
    +
    +

    Queries a dictionary of attribute values or as specified by the QueryChainableBuilderType built from a chain of clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    +
    let results = dataStack.queryAttributes(
    +    From<MyPersonEntity>()
    +        .select(
    +            NSDictionary.self,
    +            .attribute(\.age, as: "age"),
    +            .count(\.age, as: "numberOfPeople")
    +         )
    +        .groupBy(\.age)
    +)
    +for dictionary in results! {
    +    let age = dictionary["age"] as! Int
    +    let count = dictionary["numberOfPeople"] as! Int
    +    print("There are \(count) people who are \(age) years old."
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queryAttributes<B>(_ clauseChain: B) -> [[String : Any]]? where B : QueryChainableBuilderType, B.ResultType == NSDictionary
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a QueryChainableBuilderType indicating the properties to fetch and the series of queries for the request.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query as specified by the QueryChainableBuilderType

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + unsafeContext() + +
    +
    +
    +
    +
    +
    +

    The internal NSManagedObjectContext managed by this instance. Using this context directly should typically be avoided, and is provided by CoreStore only for extremely specialized cases.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func unsafeContext() -> NSManagedObjectContext
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CSAsynchronousDataTransaction.html b/docs/Classes/CSAsynchronousDataTransaction.html new file mode 100644 index 0000000..871b525 --- /dev/null +++ b/docs/Classes/CSAsynchronousDataTransaction.html @@ -0,0 +1,1212 @@ + + + + CSAsynchronousDataTransaction Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSAsynchronousDataTransaction

+
+
+
@objc
+public final class CSAsynchronousDataTransaction : CSBaseDataTransaction, CoreStoreObjectiveCType
+ +
+
+

The CSAsynchronousDataTransaction serves as the Objective-C bridging type for AsynchronousDataTransaction.

+
+

See also

+ AsynchronousDataTransaction + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Saves the transaction changes. This method should not be used after the -commitWithCompletion: method was already called once.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func commitWithSuccess(_ success: (() -> Void)?, failure: ((CSError) -> Void)?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + success + + +
    +

    the block executed if the save succeeds.

    +
    +
    + + failure + + +
    +

    the block executed if the save fails. A CSError is reported as the argument of the block.

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + createInto(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a new NSManagedObject with the specified entity type.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public override func createInto(_ into: CSInto) -> Any
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + into + + +
    +

    the CSInto clause indicating the destination NSManagedObject entity type and the destination configuration

    +
    +
    +
    +
    +

    Return Value

    +

    a new NSManagedObject instance of the specified entity type.

    +
    +
    +
    +
  • +
  • +
    + + + + editObject(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an editable proxy of a specified NSManagedObject. This method should not be used after the -commitWithCompletion: method was already called once.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public override func editObject(_ object: NSManagedObject?) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject type to be edited

    +
    +
    +
    +
    +

    Return Value

    +

    an editable proxy for the specified NSManagedObject.

    +
    +
    +
    +
  • +
  • +
    + + + + editInto(_:objectID:) + +
    +
    +
    +
    +
    +
    +

    Returns an editable proxy of the object with the specified NSManagedObjectID. This method should not be used after the -commitWithCompletion: method was already called once.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public override func editInto(_ into: CSInto, objectID: NSManagedObjectID) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + into + + +
    +

    a CSInto clause specifying the entity type

    +
    +
    + + objectID + + +
    +

    the NSManagedObjectID for the object to be edited

    +
    +
    +
    +
    +

    Return Value

    +

    an editable proxy for the specified NSManagedObject.

    +
    +
    +
    +
  • +
  • +
    + + + + deleteObject(_:) + +
    +
    +
    +
    +
    +
    +

    Deletes a specified NSManagedObject. This method should not be used after the -commitWithCompletion: method was already called once.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public override func deleteObject(_ object: NSManagedObject?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject type to be deleted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + deleteObjects(_:) + +
    +
    +
    +
    +
    +
    +

    Deletes the specified NSManagedObjects.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public override func deleteObjects(_ objects: [NSManagedObject])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objects + + +
    +

    the NSManagedObjects type to be deleted

    +
    +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CSBaseDataTransaction.html b/docs/Classes/CSBaseDataTransaction.html new file mode 100644 index 0000000..7bec729 --- /dev/null +++ b/docs/Classes/CSBaseDataTransaction.html @@ -0,0 +1,2150 @@ + + + + CSBaseDataTransaction Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSBaseDataTransaction

+
+
+
@objc
+public class CSBaseDataTransaction : NSObject
+ +
+
+

The CSBaseDataTransaction serves as the Objective-C bridging type for BaseDataTransaction.

+
+

See also

+ BaseDataTransaction + +
+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + hasChanges + +
    +
    +
    +
    +
    +
    +

    Indicates if the transaction has pending changes

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var hasChanges: Bool { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + createInto(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a new NSManagedObject with the specified entity type.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func createInto(_ into: CSInto) -> Any
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + into + + +
    +

    the CSInto clause indicating the destination NSManagedObject entity type and the destination configuration

    +
    +
    +
    +
    +

    Return Value

    +

    a new NSManagedObject instance of the specified entity type.

    +
    +
    +
    +
  • +
  • +
    + + + + editObject(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an editable proxy of a specified NSManagedObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func editObject(_ object: NSManagedObject?) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject type to be edited

    +
    +
    +
    +
    +

    Return Value

    +

    an editable proxy for the specified NSManagedObject.

    +
    +
    +
    +
  • +
  • +
    + + + + editInto(_:objectID:) + +
    +
    +
    +
    +
    +
    +

    Returns an editable proxy of the object with the specified NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func editInto(_ into: CSInto, objectID: NSManagedObjectID) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + into + + +
    +

    a CSInto clause specifying the entity type

    +
    +
    + + objectID + + +
    +

    the NSManagedObjectID for the object to be edited

    +
    +
    +
    +
    +

    Return Value

    +

    an editable proxy for the specified NSManagedObject.

    +
    +
    +
    +
  • +
  • +
    + + + + deleteObject(_:) + +
    +
    +
    +
    +
    +
    +

    Deletes a specified NSManagedObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func deleteObject(_ object: NSManagedObject?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject to be deleted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + deleteObjects(_:) + +
    +
    +
    +
    +
    +
    +

    Deletes the specified NSManagedObjects.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func deleteObjects(_ objects: [NSManagedObject])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objects + + +
    +

    the NSManagedObjects to be deleted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Refreshes all registered objects NSManagedObjects in the transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func refreshAndMergeAllObjects()
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjects of the specified type that were inserted to the transaction. This method should not be called after the -commit*: method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func insertedObjectsOfType(_ entity: NSManagedObject.Type) -> Set<NSManagedObject>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the NSManagedObject subclass to filter

    +
    +
    +
    +
    +

    Return Value

    +

    an NSSet of pending NSManagedObjects of the specified type that were inserted to the transaction.

    +
    +
    +
    +
  • +
  • +
    + + + + insertedObjectIDs() + +
    +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjectIDs that were inserted to the transaction. This method should not be called after the -commit*: method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func insertedObjectIDs() -> Set<NSManagedObjectID>
    + +
    +
    +
    +

    Return Value

    +

    an NSSet of pending NSManagedObjectIDs that were inserted to the transaction.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjectIDs of the specified type that were inserted to the transaction. This method should not be called after the -commit*: method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func insertedObjectIDsOfType(_ entity: NSManagedObject.Type) -> Set<NSManagedObjectID>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the NSManagedObject subclass to filter

    +
    +
    +
    +
    +

    Return Value

    +

    an NSSet of pending NSManagedObjectIDs of the specified type that were inserted to the transaction.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjects of the specified type that were updated in the transaction. This method should not be called after the -commit*: method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func updatedObjectsOfType(_ entity: NSManagedObject.Type) -> Set<NSManagedObject>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the NSManagedObject subclass to filter

    +
    +
    +
    +
    +

    Return Value

    +

    an NSSet of pending NSManagedObjects of the specified type that were updated in the transaction.

    +
    +
    +
    +
  • +
  • +
    + + + + updatedObjectIDs() + +
    +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjectIDs that were updated in the transaction. This method should not be called after the -commit*: method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func updatedObjectIDs() -> Set<NSManagedObjectID>
    + +
    +
    +
    +

    Return Value

    +

    an NSSet of pending NSManagedObjectIDs that were updated in the transaction.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjectIDs of the specified type that were updated in the transaction. This method should not be called after the -commit*: method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func updatedObjectIDsOfType(_ entity: NSManagedObject.Type) -> Set<NSManagedObjectID>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the NSManagedObject subclass to filter

    +
    +
    +
    +
    +

    Return Value

    +

    an NSSet of pending NSManagedObjectIDs of the specified type that were updated in the transaction.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjects of the specified type that were deleted from the transaction. This method should not be called after the -commit*: method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func deletedObjectsOfType(_ entity: NSManagedObject.Type) -> Set<NSManagedObject>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the NSManagedObject subclass to filter

    +
    +
    +
    +
    +

    Return Value

    +

    an NSSet of pending NSManagedObjects of the specified type that were deleted from the transaction.

    +
    +
    +
    +
  • +
  • +
    + + + + deletedObjectIDs() + +
    +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjectIDs of the specified type that were deleted from the transaction. This method should not be called after the -commit*: method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func deletedObjectIDs() -> Set<NSManagedObjectID>
    + +
    +
    +
    +

    Return Value

    +

    an NSSet of pending NSManagedObjectIDs of the specified type that were deleted from the transaction.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjectIDs of the specified type that were deleted from the transaction. This method should not be called after the -commit*: method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func deletedObjectIDsOfType(_ entity: NSManagedObject.Type) -> Set<NSManagedObjectID>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the NSManagedObject subclass to filter

    +
    +
    +
    +
    +

    Return Value

    +

    a Set of pending NSManagedObjectIDs of the specified type that were deleted from the transaction.

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Fetches the NSManagedObject instance in the transaction’s context from a reference created from a transaction or from a different managed object context.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchExistingObject(_ object: NSManagedObject) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    a reference to the object created/fetched outside the transaction

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject instance if the object exists in the transaction, or nil if not found.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches the NSManagedObject instance in the transaction’s context from an NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchExistingObjectWithID(_ objectID: NSManagedObjectID) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objectID + + +
    +

    the NSManagedObjectID for the object

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject instance if the object exists in the transaction, or nil if not found.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches the NSManagedObject instances in the transaction’s context from references created from a transaction or from a different managed object context.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchExistingObjects(_ objects: [NSManagedObject]) -> [Any]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objects + + +
    +

    an array of NSManagedObjects created/fetched outside the transaction

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject array for objects that exists in the transaction

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches the NSManagedObject instances in the transaction’s context from a list of NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchExistingObjectsWithIDs(_ objectIDs: [NSManagedObjectID]) -> [Any]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objectIDs + + +
    +

    the NSManagedObjectID array for the objects

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject array for objects that exists in the transaction

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches the first NSManagedObject instance that satisfies the specified CSFetchClauses. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchOneFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for the fetch request. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the first NSManagedObject instance that satisfies the specified CSFetchClauses

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches all NSManagedObject instances that satisfy the specified CSFetchClauses. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchAllFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> [Any]?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for the fetch request. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    all NSManagedObject instances that satisfy the specified CSFetchClauses

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches the number of NSManagedObjects that satisfy the specified CSFetchClauses. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchCountFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> NSNumber?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for the fetch request. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the number NSManagedObjects that satisfy the specified CSFetchClauses

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for the first NSManagedObject that satisfies the specified CSFetchClauses. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchObjectIDFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> NSManagedObjectID?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for the fetch request. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first NSManagedObject that satisfies the specified CSFetchClauses

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Queries aggregate values as specified by the CSQueryClauses. Requires at least a CSSelect clause, and optional CSWhere, CSOrderBy, CSGroupBy, and CSTweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func queryValueFrom(_ from: CSFrom, selectClause: CSSelect, queryClauses: [CSQueryClause]) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a CSSelect clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of CSQueryClause instances for the query request. Accepts CSWhere, CSOrderBy, CSGroupBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the CSSelect parameter.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Queries a dictionary of attribute values as specified by the CSQueryClauses. Requires at least a CSSelect clause, and optional CSWhere, CSOrderBy, CSGroupBy, and CSTweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func queryAttributesFrom(_ from: CSFrom, selectClause: CSSelect, queryClauses: [CSQueryClause]) -> [[String : Any]]?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a CSSelect clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of CSQueryClause instances for the query request. Accepts CSWhere, CSOrderBy, CSGroupBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the CSSelect parameter.

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CSCoreStore.html b/docs/Classes/CSCoreStore.html new file mode 100644 index 0000000..89fd739 --- /dev/null +++ b/docs/Classes/CSCoreStore.html @@ -0,0 +1,2721 @@ + + + + CSCoreStore Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSCoreStore

+
+
+
@objc
+public final class CSCoreStore : NSObject
+ +
+
+

The CSCoreStore serves as the Objective-C bridging type for CoreStore.

+
+

See also

+ CoreStore + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + defaultStack + +
    +
    +
    +
    +
    +
    +

    The default CSDataStack instance to be used. If defaultStack is not set before the first time accessed, a default-configured CSDataStack will be created.

    +
    +

    See also

    + CSDataStack + +
    +
    +

    Note

    + Changing the defaultStack is thread safe, but it is recommended to setup CSDataStacks on a common queue (e.g. the main queue). + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static var defaultStack: CSDataStack { get set }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Asynchronously adds a CSInMemoryStore to the defaultStack. Migrations are also initiated by default.

    +
    NSError *error;
    +NSProgress *migrationProgress = [dataStack
    +    addInMemoryStorage:[CSInMemoryStore new]
    +    completion:^(CSSetupResult *result) {
    +        if (result.isSuccess) {
    +            // ...
    +        }
    +    }
    +    error: &error];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func addInMemoryStorage(_ storage: CSInMemoryStore, completion: @escaping (CSSetupResult) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the CSInMemoryStore instance

    +
    +
    + + completion + + +
    +

    the closure to be executed on the main queue when the process completes, either due to success or failure. The closure’s CSSetupResult argument indicates the result. This closure is NOT executed if an error is thrown, but will be executed with a failure CSSetupResult result if an error occurs asynchronously.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously adds a CSSQLiteStore to the defaultStack. Migrations are also initiated by default.

    +
    NSError *error;
    +NSProgress *migrationProgress = [dataStack
    +    addInMemoryStorage:[[CSSQLiteStore alloc]
    +    initWithFileName:@"core_data.sqlite"
    +    configuration:@"Config1"]
    +    completion:^(CSSetupResult *result) {
    +        if (result.isSuccess) {
    +            // ...
    +        }
    +    }
    +    error: &error];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func addSQLiteStorage(_ storage: CSSQLiteStore, completion: @escaping (CSSetupResult) -> Void, error: NSErrorPointer) -> Progress?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + storage + + +
    +

    the CSSQLiteStore instance

    +
    +
    + + completion + + +
    +

    the closure to be executed on the main queue when the process completes, either due to success or failure. The closure’s CSSetupResult argument indicates the result. This closure is NOT executed if an error is thrown, but will be executed with a failure CSSetupResult result if an error occurs asynchronously. Note that the CSLocalStorage associated to the -[CSSetupResult storage] may not always be the same instance as the parameter argument if a previous CSLocalStorage was already added at the same URL and with the same configuration.

    +
    +
    + + error + + +
    +

    the NSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    an NSProgress instance if a migration has started. nil if no migrations are required or if error was set.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Migrates a CSSQLiteStore to match the defaultStack‘s managed object model version. This method does NOT add the migrated store to the data stack.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func upgradeStorageIfNeeded(_ storage: CSSQLiteStore, completion: @escaping (CSMigrationResult) -> Void, error: NSErrorPointer) -> Progress?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + storage + + +
    +

    the CSSQLiteStore instance

    +
    +
    + + completion + + +
    +

    the closure to be executed on the main queue when the migration completes, either due to success or failure. The closure’s CSMigrationResult argument indicates the result. This closure is NOT executed if an error is thrown, but will be executed with a failure CSSetupResult result if an error occurs asynchronously.

    +
    +
    + + error + + +
    +

    the NSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    an NSProgress instance if a migration has started. nil if no migrations are required or if error was set.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Checks the migration steps required for the CSSQLiteStore to match the defaultStack‘s managed object model version.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func requiredMigrationsForSQLiteStore(_ storage: CSSQLiteStore, error: NSErrorPointer) -> [CSMigrationType]?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the CSSQLiteStore instance

    +
    +
    + + error + + +
    +

    the NSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    a CSMigrationType array indicating the migration steps required for the store, or an empty array if the file does not exist yet. Otherwise, nil is returned and the error argument is set if either inspection of the store failed, or if no mapping model was found/inferred.

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + monitorObject(_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, creates an CSObjectMonitor for the specified NSManagedObject. Multiple CSObjectObservers may then register themselves to be notified when changes are made to the NSManagedObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func monitorObject(_ object: NSManagedObject) -> CSObjectMonitor
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject to observe changes from

    +
    +
    +
    +
    +

    Return Value

    +

    a CSObjectMonitor that monitors changes to object

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, creates a CSListMonitor for a list of NSManagedObjects that satisfy the specified fetch clauses. Multiple CSListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func monitorListFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> CSListMonitor
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for fetching the object list. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a CSListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, asynchronously creates a CSListMonitor for a list of NSManagedObjects that satisfy the specified fetch clauses. Multiple CSListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func monitorListByCreatingAsynchronously(_ createAsynchronously: @escaping (CSListMonitor) -> Void, from: CSFrom, fetchClauses: [CSFetchClause])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created CSListMonitor instance

    +
    +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for fetching the object list. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, creates a CSListMonitor for a sectioned list of NSManagedObjects that satisfy the specified fetch clauses. Multiple CSListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func monitorSectionedListFrom(_ from: CSFrom, sectionBy: CSSectionBy, fetchClauses: [CSFetchClause]) -> CSListMonitor
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a CSSectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for fetching the object list. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a CSListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, asynchronously creates a CSListMonitor for a sectioned list of NSManagedObjects that satisfy the specified fetch clauses. Multiple CSListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func monitorSectionedListByCreatingAsynchronously(_ createAsynchronously: @escaping (CSListMonitor) -> Void, from: CSFrom, sectionBy: CSSectionBy, fetchClauses: [CSFetchClause])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created CSListMonitor instance

    +
    +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a CSSectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for fetching the object list. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the NSManagedObject instance in the transaction’s context from a reference created from a transaction or from a different managed object context.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func fetchExistingObject(_ object: NSManagedObject) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    a reference to the object created/fetched outside the transaction

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject instance if the object exists in the transaction, or nil if not found.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the NSManagedObject instance in the transaction’s context from an NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func fetchExistingObjectWithID(_ objectID: NSManagedObjectID) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objectID + + +
    +

    the NSManagedObjectID for the object

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject instance if the object exists in the transaction, or nil if not found.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the NSManagedObject instances in the transaction’s context from references created from a transaction or from a different managed object context.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func fetchExistingObjects(_ objects: [NSManagedObject]) -> [Any]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objects + + +
    +

    an array of NSManagedObjects created/fetched outside the transaction

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject array for objects that exists in the transaction

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the NSManagedObject instances in the transaction’s context from a list of NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func fetchExistingObjectsWithIDs(_ objectIDs: [NSManagedObjectID]) -> [Any]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objectIDs + + +
    +

    the NSManagedObjectID array for the objects

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject array for objects that exists in the transaction

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the first NSManagedObject instance that satisfies the specified CSFetchClauses. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func fetchOneFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for the fetch request. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the first NSManagedObject instance that satisfies the specified CSFetchClauses

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches all NSManagedObject instances that satisfy the specified CSFetchClauses. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func fetchAllFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> [Any]?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for the fetch request. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    all NSManagedObject instances that satisfy the specified CSFetchClauses

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the number of NSManagedObjects that satisfy the specified CSFetchClauses. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func fetchCountFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> NSNumber?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for the fetch request. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the number NSManagedObjects that satisfy the specified CSFetchClauses

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the NSManagedObjectID for the first NSManagedObject that satisfies the specified CSFetchClauses. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func fetchObjectIDFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> NSManagedObjectID?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for the fetch request. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first NSManagedObject that satisfies the specified CSFetchClauses

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the NSManagedObjectID for all NSManagedObjects that satisfy the specified CSFetchClauses. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func fetchObjectIDsFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> [NSManagedObjectID]?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for all NSManagedObjects that satisfy the specified CSFetchClauses

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, queries aggregate values as specified by the CSQueryClauses. Requires at least a CSSelect clause, and optional CSWhere, CSOrderBy, CSGroupBy, and CSTweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func queryValueFrom(_ from: CSFrom, selectClause: CSSelect, queryClauses: [CSQueryClause]) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a CSSelect clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of CSQueryClause instances for the query request. Accepts CSWhere, CSOrderBy, CSGroupBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the CSSelect parameter.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, queries a dictionary of attribute values as specified by the CSQueryClauses. Requires at least a CSSelect clause, and optional CSWhere, CSOrderBy, CSGroupBy, and CSTweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func queryAttributesFrom(_ from: CSFrom, selectClause: CSSelect, queryClauses: [CSQueryClause]) -> [[String : Any]]?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a CSSelect clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of CSQueryClause instances for the query request. Accepts CSWhere, CSOrderBy, CSGroupBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the CSSelect parameter.

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + modelVersion + +
    +
    +
    +
    +
    +
    +

    Returns the defaultStack‘s model version. The version string is the same as the name of the version-specific .xcdatamodeld file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static var modelVersion: String { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the entity name-to-class type mapping from the defaultStack‘s model.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func entityTypesByNameForType(_ type: NSManagedObject.Type) -> [EntityName : NSManagedObject.Type]
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the NSEntityDescription for the specified NSManagedObject subclass from defaultStack‘s model.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func entityDescriptionForClass(_ type: NSManagedObject.Type) -> NSEntityDescription?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates an CSInMemoryStore with default parameters and adds it to the defaultStack. This method blocks until completion.

    +
    CSSQLiteStore *storage = [CSCoreStore addInMemoryStorageAndWaitAndReturnError:&error];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +@objc
    +public static func addInMemoryStorageAndWaitAndReturnError(_ error: NSErrorPointer) -> CSInMemoryStore?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + error + + +
    +

    the NSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    the CSInMemoryStore added to the defaultStack

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates an CSSQLiteStore with default parameters and adds it to the defaultStack. This method blocks until completion.

    +
    CSSQLiteStore *storage = [CSCoreStore addSQLiteStorageAndWaitAndReturnError:&error];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +@objc
    +public static func addSQLiteStorageAndWaitAndReturnError(_ error: NSErrorPointer) -> CSSQLiteStore?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + error + + +
    +

    the NSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    the CSSQLiteStore added to the defaultStack

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Adds a CSInMemoryStore to the defaultStack and blocks until completion.

    +
    NSError *error;
    +CSInMemoryStore *storage = [CSCoreStore
    +    addStorageAndWait: [[CSInMemoryStore alloc] initWithConfiguration: @"Config1"]
    +    error: &error];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +@objc
    +public static func addInMemoryStorageAndWait(_ storage: CSInMemoryStore, error: NSErrorPointer) -> CSInMemoryStore?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the CSInMemoryStore

    +
    +
    + + error + + +
    +

    the NSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    the CSInMemoryStore added to the defaultStack

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Adds a CSSQLiteStore to the defaultStack and blocks until completion.

    +
    NSError *error;
    +CSSQLiteStore *storage = [CSCoreStore
    +    addStorageAndWait: [[CSSQLiteStore alloc] initWithConfiguration: @"Config1"]
    +    error: &error];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +@objc
    +public static func addSQLiteStorageAndWait(_ storage: CSSQLiteStore, error: NSErrorPointer) -> CSSQLiteStore?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the CSSQLiteStore

    +
    +
    + + error + + +
    +

    the NSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    the CSSQLiteStore added to the defaultStack

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + beginAsynchronous(_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, begins a transaction asynchronously where NSManagedObject creates, updates, and deletes can be made.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func beginAsynchronous(_ closure: @escaping (_ transaction: CSAsynchronousDataTransaction) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + closure + + +
    +

    the block where creates, updates, and deletes can be made to the transaction. Transaction blocks are executed serially in a background queue, and all changes are made from a concurrent NSManagedObjectContext.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, begins a transaction synchronously where NSManagedObject creates, updates, and deletes can be made.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func beginSynchronous(_ closure: @escaping (_ transaction: CSSynchronousDataTransaction) -> Void, error: NSErrorPointer) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + closure + + +
    +

    the block where creates, updates, and deletes can be made to the transaction. Transaction blocks are executed serially in a background queue, and all changes are made from a concurrent NSManagedObjectContext.

    +
    +
    +
    +
    +

    Return Value

    +

    a CSSaveResult value indicating success or failure, or nil if the transaction was not comitted synchronously

    +
    +
    +
    +
  • +
  • +
    + + + + beginUnsafe() + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, begins a child transaction where NSManagedObject creates, updates, and deletes can be made. This is useful for making temporary changes, such as partially filled forms.

    + +

    To support undo methods such as -undo, -redo, and -rollback, use the -beginSafeWithSupportsUndo: method passing YES to the argument. Without undo support, calling those methods will raise an exception.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func beginUnsafe() -> CSUnsafeDataTransaction
    + +
    +
    +
    +

    Return Value

    +

    a CSUnsafeDataTransaction instance where creates, updates, and deletes can be made.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, begins a child transaction where NSManagedObject creates, updates, and deletes can be made. This is useful for making temporary changes, such as partially filled forms.

    + +
      +
    • prameter supportsUndo: -undo, -redo, and -rollback methods are only available when this parameter is YES, otherwise those method will raise an exception. Note that turning on Undo support may heavily impact performance especially on iOS or watchOS where memory is limited.
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func beginUnsafeWithSupportsUndo(_ supportsUndo: Bool) -> CSUnsafeDataTransaction
    + +
    +
    +
    +

    Return Value

    +

    a CSUnsafeDataTransaction instance where creates, updates, and deletes can be made.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Refreshes all registered objects NSManagedObjects in the defaultStack.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func refreshAndMergeAllObjects()
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CSDataStack.html b/docs/Classes/CSDataStack.html new file mode 100644 index 0000000..4e4a80f --- /dev/null +++ b/docs/Classes/CSDataStack.html @@ -0,0 +1,2847 @@ + + + + CSDataStack Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSDataStack

+
+
+
@objc
+public final class CSDataStack : NSObject, CoreStoreObjectiveCType
+ +
+
+

The CSDataStack serves as the Objective-C bridging type for DataStack.

+
+

See also

+ DataStack + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes a CSDataStack with default settings. CoreStore searches for .xcdatamodeld from the main NSBundle and loads an NSManagedObjectModel from it. An assertion is raised if the model could not be found.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience override init()
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a CSDataStack from the model with the specified modelName in the specified bundle.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(xcodeModelName: XcodeDataModelFileName?, bundle: Bundle?, versionChain: [String]?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + xcodeModelName + + +
    +

    the name of the (.xcdatamodeld) model file. If not specified, the application name (CFBundleName) will be used if it exists, or CoreData if it the bundle name was not set.

    +
    +
    + + bundle + + +
    +

    an optional bundle to load models from. If not specified, the main bundle will be used.

    +
    +
    + + versionChain + + +
    +

    the version strings that indicate the sequence of model versions to be used as the order for progressive migrations. If not specified, will default to a non-migrating data stack.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + modelVersion + +
    +
    +
    +
    +
    +
    +

    Returns the stack’s model version. The version string is the same as the name of the version-specific .xcdatamodeld file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var modelVersion: String { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the entity name-to-class type mapping from the CSDataStack‘s model.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func entityTypesByNameForType(_ type: NSManagedObject.Type) -> [EntityName : NSManagedObject.Type]
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the NSEntityDescription for the specified NSManagedObject subclass from stack’s model.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func entityDescriptionForClass(_ type: NSManagedObject.Type) -> NSEntityDescription?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates an CSInMemoryStore with default parameters and adds it to the stack. This method blocks until completion.

    +
    CSSQLiteStore *storage = [dataStack addInMemoryStorageAndWaitAndReturnError:&error];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +@objc
    +public func addInMemoryStorageAndWaitAndReturnError(_ error: NSErrorPointer) -> CSInMemoryStore?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + error + + +
    +

    the NSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    the CSInMemoryStore added to the stack

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates an CSSQLiteStore with default parameters and adds it to the stack. This method blocks until completion.

    +
    CSSQLiteStore *storage = [dataStack addSQLiteStorageAndWaitAndReturnError:&error];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +@objc
    +public func addSQLiteStorageAndWaitAndReturnError(_ error: NSErrorPointer) -> CSSQLiteStore?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + error + + +
    +

    the NSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    the CSSQLiteStore added to the stack

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Adds a CSInMemoryStore to the stack and blocks until completion.

    +
    NSError *error;
    +CSInMemoryStore *storage = [dataStack
    +    addStorageAndWait: [[CSInMemoryStore alloc] initWithConfiguration: @"Config1"]
    +    error: &error];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +@objc
    +public func addInMemoryStorageAndWait(_ storage: CSInMemoryStore, error: NSErrorPointer) -> CSInMemoryStore?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the CSInMemoryStore

    +
    +
    + + error + + +
    +

    the NSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    the CSInMemoryStore added to the stack

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Adds a CSSQLiteStore to the stack and blocks until completion.

    +
    NSError *error;
    +CSSQLiteStore *storage = [dataStack
    +    addStorageAndWait: [[CSSQLiteStore alloc] initWithConfiguration: @"Config1"]
    +    error: &error];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +@objc
    +public func addSQLiteStorageAndWait(_ storage: CSSQLiteStore, error: NSErrorPointer) -> CSSQLiteStore?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the CSSQLiteStore

    +
    +
    + + error + + +
    +

    the NSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    the CSSQLiteStore added to the stack

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + bridgeToSwift + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let bridgeToSwift: DataStack
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ swiftValue: DataStack)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Asynchronously adds a CSInMemoryStore to the stack. Migrations are also initiated by default.

    +
    NSError *error;
    +NSProgress *migrationProgress = [dataStack 
    +    addInMemoryStorage:[CSInMemoryStore new]
    +    completion:^(CSSetupResult *result) {
    +        if (result.isSuccess) {
    +            // ...
    +        }
    +    }
    +    error: &error];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func addInMemoryStorage(_ storage: CSInMemoryStore, completion: @escaping (CSSetupResult) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the CSInMemoryStore instance

    +
    +
    + + completion + + +
    +

    the closure to be executed on the main queue when the process completes, either due to success or failure. The closure’s CSSetupResult argument indicates the result. This closure is NOT executed if an error is thrown, but will be executed with a failure CSSetupResult result if an error occurs asynchronously.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously adds a CSSQLiteStore to the stack. Migrations are also initiated by default.

    +
    NSError *error;
    +NSProgress *migrationProgress = [dataStack
    +    addInMemoryStorage:[[CSSQLiteStore alloc] 
    +        initWithFileName:@"core_data.sqlite"
    +        configuration:@"Config1"]
    +    completion:^(CSSetupResult *result) {
    +        if (result.isSuccess) {
    +            // ...
    +        }
    +    }
    +    error: &error];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func addSQLiteStorage(_ storage: CSSQLiteStore, completion: @escaping (CSSetupResult) -> Void, error: NSErrorPointer) -> Progress?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + storage + + +
    +

    the CSSQLiteStore instance

    +
    +
    + + completion + + +
    +

    the closure to be executed on the main queue when the process completes, either due to success or failure. The closure’s CSSetupResult argument indicates the result. This closure is NOT executed if an error is thrown, but will be executed with a failure CSSetupResult result if an error occurs asynchronously. Note that the CSLocalStorage associated to the -[CSSetupResult storage] may not always be the same instance as the parameter argument if a previous CSLocalStorage was already added at the same URL and with the same configuration.

    +
    +
    + + error + + +
    +

    the NSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    an NSProgress instance if a migration has started. nil if no migrations are required or if error was set.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Migrates a CSSQLiteStore to match the CSDataStack‘s managed object model version. This method does NOT add the migrated store to the data stack.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func upgradeStorageIfNeeded(_ storage: CSSQLiteStore, completion: @escaping (CSMigrationResult) -> Void, error: NSErrorPointer) -> Progress?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + storage + + +
    +

    the CSSQLiteStore instance

    +
    +
    + + completion + + +
    +

    the closure to be executed on the main queue when the migration completes, either due to success or failure. The closure’s CSMigrationResult argument indicates the result. This closure is NOT executed if an error is thrown, but will be executed with a failure CSSetupResult result if an error occurs asynchronously.

    +
    +
    + + error + + +
    +

    the NSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    an NSProgress instance if a migration has started. nil if no migrations are required or if error was set.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Checks the migration steps required for the CSSQLiteStore to match the CSDataStack‘s managed object model version.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func requiredMigrationsForSQLiteStore(_ storage: CSSQLiteStore, error: NSErrorPointer) -> [CSMigrationType]?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the CSSQLiteStore instance

    +
    +
    + + error + + +
    +

    the NSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    a CSMigrationType array indicating the migration steps required for the store, or an empty array if the file does not exist yet. Otherwise, nil is returned and the error argument is set if either inspection of the store failed, or if no mapping model was found/inferred.

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + monitorObject(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a CSObjectMonitor for the specified NSManagedObject. Multiple ObjectObservers may then register themselves to be notified when changes are made to the NSManagedObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func monitorObject(_ object: NSManagedObject) -> CSObjectMonitor
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject to observe changes from

    +
    +
    +
    +
    +

    Return Value

    +

    a ObjectMonitor that monitors changes to object

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a CSListMonitor for a list of NSManagedObjects that satisfy the specified fetch clauses. Multiple CSListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func monitorListFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> CSListMonitor
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a CSListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a CSListMonitor for a list of NSManagedObjects that satisfy the specified fetch clauses. Multiple CSListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func monitorListByCreatingAsynchronously(_ createAsynchronously: @escaping (CSListMonitor) -> Void, from: CSFrom, fetchClauses: [CSFetchClause])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created CSListMonitor instance

    +
    +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for fetching the object list. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a CSListMonitor for a sectioned list of NSManagedObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func monitorSectionedListFrom(_ from: CSFrom, sectionBy: CSSectionBy, fetchClauses: [CSFetchClause]) -> CSListMonitor
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a CSSectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a CSListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a CSListMonitor for a sectioned list of NSManagedObjects that satisfy the specified fetch clauses. Multiple CSListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorSectionedListByCreatingAsynchronously(_ createAsynchronously: @escaping (CSListMonitor) -> Void, from: CSFrom, sectionBy: CSSectionBy, fetchClauses: [CSFetchClause])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created CSListMonitor instance

    +
    +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a CSSectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for fetching the object list. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Fetches the NSManagedObject instance in the transaction’s context from a reference created from a transaction or from a different managed object context.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchExistingObject(_ object: NSManagedObject) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    a reference to the object created/fetched outside the transaction

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject instance if the object exists in the transaction, or nil if not found.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches the NSManagedObject instance in the transaction’s context from an NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchExistingObjectWithID(_ objectID: NSManagedObjectID) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objectID + + +
    +

    the NSManagedObjectID for the object

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject instance if the object exists in the transaction, or nil if not found.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches the NSManagedObject instances in the transaction’s context from references created from a transaction or from a different managed object context.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchExistingObjects(_ objects: [NSManagedObject]) -> [Any]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objects + + +
    +

    an array of NSManagedObjects created/fetched outside the transaction

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject array for objects that exists in the transaction

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches the NSManagedObject instances in the transaction’s context from a list of NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchExistingObjectsWithIDs(_ objectIDs: [NSManagedObjectID]) -> [Any]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objectIDs + + +
    +

    the NSManagedObjectID array for the objects

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject array for objects that exists in the transaction

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches the first NSManagedObject instance that satisfies the specified CSFetchClauses. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchOneFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for the fetch request. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the first NSManagedObject instance that satisfies the specified CSFetchClauses

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches all NSManagedObject instances that satisfy the specified CSFetchClauses. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchAllFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> [Any]?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for the fetch request. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    all NSManagedObject instances that satisfy the specified CSFetchClauses

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches the number of NSManagedObjects that satisfy the specified CSFetchClauses. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchCountFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> NSNumber?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for the fetch request. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the number NSManagedObjects that satisfy the specified CSFetchClauses

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for the first NSManagedObject that satisfies the specified CSFetchClauses. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchObjectIDFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> NSManagedObjectID?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for the fetch request. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first NSManagedObject that satisfies the specified CSFetchClauses

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for all NSManagedObjects that satisfy the specified CSFetchClauses. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchObjectIDsFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> [NSManagedObjectID]?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for all NSManagedObjects that satisfy the specified CSFetchClauses

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Queries aggregate values as specified by the CSQueryClauses. Requires at least a CSSelect clause, and optional CSWhere, CSOrderBy, CSGroupBy, and CSTweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func queryValueFrom(_ from: CSFrom, selectClause: CSSelect, queryClauses: [CSQueryClause]) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a CSSelect clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of CSQueryClause instances for the query request. Accepts CSWhere, CSOrderBy, CSGroupBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the CSSelect parameter.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Queries a dictionary of attribute values as specified by the CSQueryClauses. Requires at least a CSSelect clause, and optional CSWhere, CSOrderBy, CSGroupBy, and CSTweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func queryAttributesFrom(_ from: CSFrom, selectClause: CSSelect, queryClauses: [CSQueryClause]) -> [[String : Any]]?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a CSSelect clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of CSQueryClause instances for the query request. Accepts CSWhere, CSOrderBy, CSGroupBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the CSSelect parameter.

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + beginAsynchronous(_:) + +
    +
    +
    +
    +
    +
    +

    Begins a transaction asynchronously where NSManagedObject creates, updates, and deletes can be made.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func beginAsynchronous(_ closure: @escaping (_ transaction: CSAsynchronousDataTransaction) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + closure + + +
    +

    the block where creates, updates, and deletes can be made to the transaction. Transaction blocks are executed serially in a background queue, and all changes are made from a concurrent NSManagedObjectContext.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Begins a transaction synchronously where NSManagedObject creates, updates, and deletes can be made.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func beginSynchronous(_ closure: @escaping (_ transaction: CSSynchronousDataTransaction) -> Void, error: NSErrorPointer) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + closure + + +
    +

    the block where creates, updates, and deletes can be made to the transaction. Transaction blocks are executed serially in a background queue, and all changes are made from a concurrent NSManagedObjectContext.

    +
    +
    + + error + + +
    +

    the CSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    YES if the commit succeeded, NO if the commit failed. If NO, the error argument will hold error information.

    +
    +
    +
    +
  • +
  • +
    + + + + beginUnsafe() + +
    +
    +
    +
    +
    +
    +

    Begins a child transaction where NSManagedObject creates, updates, and deletes can be made. This is useful for making temporary changes, such as partially filled forms.

    + +

    To support undo methods such as -undo, -redo, and -rollback, use the -beginSafeWithSupportsUndo: method passing YES to the argument. Without undo support, calling those methods will raise an exception.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func beginUnsafe() -> CSUnsafeDataTransaction
    + +
    +
    +
    +

    Return Value

    +

    a CSUnsafeDataTransaction instance where creates, updates, and deletes can be made.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Begins a child transaction where NSManagedObject creates, updates, and deletes can be made. This is useful for making temporary changes, such as partially filled forms.

    + +
      +
    • prameter supportsUndo: -undo, -redo, and -rollback methods are only available when this parameter is YES, otherwise those method will raise an exception. Note that turning on Undo support may heavily impact performance especially on iOS or watchOS where memory is limited.
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func beginUnsafeWithSupportsUndo(_ supportsUndo: Bool) -> CSUnsafeDataTransaction
    + +
    +
    +
    +

    Return Value

    +

    a CSUnsafeDataTransaction instance where creates, updates, and deletes can be made.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Refreshes all registered objects NSManagedObjects in the DataStack.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func refreshAndMergeAllObjects()
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CSError.html b/docs/Classes/CSError.html new file mode 100644 index 0000000..ff64ae0 --- /dev/null +++ b/docs/Classes/CSError.html @@ -0,0 +1,891 @@ + + + + CSError Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSError

+
+
+
@objc
+public final class CSError : NSError, CoreStoreObjectiveCType
+ +
+
+

All errors thrown from CoreStore are expressed in CSErrors.

+
+

See also

+ CoreStoreError + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + errorDomain + +
    +
    +
    +
    +
    +
    +

    The NSError error domain for CSError.

    +
    +

    See also

    + CoreStoreErrorErrorDomain + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static let errorDomain: String
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + bridgeToSwift + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var bridgeToSwift: CoreStoreError { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Do not call directly!

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ swiftValue: CoreStoreError)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CSFrom.html b/docs/Classes/CSFrom.html new file mode 100644 index 0000000..513906f --- /dev/null +++ b/docs/Classes/CSFrom.html @@ -0,0 +1,1025 @@ + + + + CSFrom Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSFrom

+
+
+
@objc
+public final class CSFrom : NSObject
+ +
+
+

The CSFrom serves as the Objective-C bridging type for From.

+
+

See also

+ From + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + entityClass + +
    +
    +
    +
    +
    +
    +

    The associated NSManagedObject entity class

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var entityClass: AnyClass { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + configurations + +
    +
    +
    +
    +
    +
    +

    The NSPersistentStore configuration names to associate objects from. +May contain NSString instances to pertain to named configurations, or NSNull to pertain to the default configuration

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var configurations: [Any]? { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(entityClass:) + +
    +
    +
    +
    +
    +
    +

    Initializes a CSFrom clause with the specified entity class.

    +
    MyPersonEntity *people = [transaction fetchAllFrom:CSFromClass([MyPersonEntity class])];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(entityClass: NSManagedObject.Type)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entityClass + + +
    +

    the NSManagedObject class type to be created

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a CSFrom clause with the specified configurations.

    +
    MyPersonEntity *people = [transaction fetchAllFrom:
    +   CSFromClass([MyPersonEntity class], @"Config1")];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(entityClass: NSManagedObject.Type, configuration: Any)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + entityClass + + +
    +

    the associated NSManagedObject entity class

    +
    +
    + + configuration + + +
    +

    the NSPersistentStore configuration name to associate objects from. This parameter is required if multiple configurations contain the created NSManagedObject‘s entity type. Set to [NSNull null] to use the default configuration.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a CSFrom clause with the specified configurations.

    +
    MyPersonEntity *people = [transaction fetchAllFrom:
    +   CSFromClass([MyPersonEntity class],
    +                @[[NSNull null], @"Config1"])];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(entityClass: NSManagedObject.Type, configurations: [Any])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + entityClass + + +
    +

    the associated NSManagedObject entity class

    +
    +
    + + configurations + + +
    +

    an array of the NSPersistentStore configuration names to associate objects from. This parameter is required if multiple configurations contain the created NSManagedObject‘s entity type. Set to [NSNull null] to use the default configuration.

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CSGroupBy.html b/docs/Classes/CSGroupBy.html new file mode 100644 index 0000000..c8cb959 --- /dev/null +++ b/docs/Classes/CSGroupBy.html @@ -0,0 +1,916 @@ + + + + CSGroupBy Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSGroupBy

+
+
+
@objc
+public final class CSGroupBy : NSObject, CSQueryClause
+ +
+
+

The CSGroupBy serves as the Objective-C bridging type for GroupBy.

+
+

See also

+ GroupBy + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + keyPaths + +
    +
    +
    +
    +
    +
    +

    The list of key path strings to group results with

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var keyPaths: [KeyPathString] { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(keyPath:) + +
    +
    +
    +
    +
    +
    +

    Initializes a CSGroupBy clause with a key path string

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(keyPath: KeyPathString)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    a key path string to group results with

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(keyPaths:) + +
    +
    +
    +
    +
    +
    +

    Initializes a CSGroupBy clause with a list of key path strings

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(keyPaths: [KeyPathString])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPaths + + +
    +

    a list of key path strings to group results with

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CSInMemoryStore.html b/docs/Classes/CSInMemoryStore.html new file mode 100644 index 0000000..9e5ca97 --- /dev/null +++ b/docs/Classes/CSInMemoryStore.html @@ -0,0 +1,1027 @@ + + + + CSInMemoryStore Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSInMemoryStore

+
+
+
@objc
+public final class CSInMemoryStore : NSObject, CSStorageInterface, CoreStoreObjectiveCType
+ +
+
+

The CSInMemoryStore serves as the Objective-C bridging type for InMemoryStore.

+
+

See also

+ InMemoryStore + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + init(configuration:) + +
    +
    +
    +
    +
    +
    +

    Initializes a CSInMemoryStore for the specified configuration

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(configuration: ModelConfiguration)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + configuration + + +
    +

    an optional configuration name from the model file. If not specified, defaults to nil, the Default configuration.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes a CSInMemoryStore with the Default configuration

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience override init()
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + storeType + +
    +
    +
    +
    +
    +
    +

    The string identifier for the NSPersistentStore‘s type property. For CSInMemoryStores, this is always set to NSInMemoryStoreType.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static let storeType: String
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    +

    The configuration name in the model file

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var configuration: ModelConfiguration { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + storeOptions + +
    +
    +
    +
    +
    +
    +

    The options dictionary for the NSPersistentStore. For CSInMemoryStores, this is always set to nil.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var storeOptions: [AnyHashable : Any]? { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + bridgeToSwift + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let bridgeToSwift: InMemoryStore
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init(_ swiftValue: InMemoryStore)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CSInto.html b/docs/Classes/CSInto.html new file mode 100644 index 0000000..bc66942 --- /dev/null +++ b/docs/Classes/CSInto.html @@ -0,0 +1,963 @@ + + + + CSInto Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSInto

+
+
+
@objc
+public final class CSInto : NSObject
+ +
+
+

The CSInto serves as the Objective-C bridging type for Into<T>.

+
+

See also

+ Into + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + entityClass + +
    +
    +
    +
    +
    +
    +

    The associated NSManagedObject entity class

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var entityClass: NSManagedObject.Type { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    +

    The NSPersistentStore configuration name to associate objects from. +May contain a String to pertain to a named configuration, or nil to pertain to the default configuration

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var configuration: ModelConfiguration { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(entityClass:) + +
    +
    +
    +
    +
    +
    +

    Initializes a CSInto clause with the specified entity class.

    +
    MyPersonEntity *person = [transaction createInto:
    +   CSIntoClass([MyPersonEntity class])];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(entityClass: NSManagedObject.Type)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entityClass + + +
    +

    the NSManagedObject class type to be created

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a CSInto clause with the specified configuration.

    +
    MyPersonEntity *person = [transaction createInto:
    +   CSIntoClass([MyPersonEntity class])];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(entityClass: NSManagedObject.Type, configuration: ModelConfiguration)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + entityClass + + +
    +

    the NSManagedObject class type to be created

    +
    +
    + + configuration + + +
    +

    the NSPersistentStore configuration name to associate the object to. This parameter is required if multiple configurations contain the created NSManagedObject‘s entity type. Set to nil to use the default configuration.

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CSListMonitor.html b/docs/Classes/CSListMonitor.html new file mode 100644 index 0000000..d53712d --- /dev/null +++ b/docs/Classes/CSListMonitor.html @@ -0,0 +1,2152 @@ + + + + CSListMonitor Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSListMonitor

+
+
+
@available(OSX 10.12, *)
+@objc
+public final class CSListMonitor : NSObject
+ +
+
+

The CSListMonitor serves as the Objective-C bridging type for ListMonitor<T>.

+
+

See also

+ ListMonitor + +
+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the object at the given index within the first section. This subscript indexer is typically used for CSListMonitors created without section groupings.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public subscript(index: Int) -> Any { get }
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + index + + +
    +

    the index of the object. Using an index above the valid range will raise an exception.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject at the specified index

    +
    +
    +
    +
  • +
  • +
    + + + + objectAtSafeIndex(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the object at the given index, or nil if out of bounds. This indexer is typically used for CSListMonitors created without section groupings.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func objectAtSafeIndex(_ index: Int) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + index + + +
    +

    the index for the object. Using an index above the valid range will return nil.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject at the specified index, or nil if out of bounds

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the object at the given sectionIndex and itemIndex. This indexer is typically used for CSListMonitors created as sectioned lists.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func objectAtSectionIndex(_ sectionIndex: Int, itemIndex: Int) -> Any
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionIndex + + +
    +

    the section index for the object. Using a sectionIndex with an invalid range will raise an exception.

    +
    +
    + + itemIndex + + +
    +

    the index for the object within the section. Using an itemIndex with an invalid range will raise an exception.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject at the specified section and item index

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the object at the given section and item index, or nil if out of bounds. This indexer is typically used for CSListMonitors created as sectioned lists.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func objectAtSafeSectionIndex(_ sectionIndex: Int, safeItemIndex itemIndex: Int) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionIndex + + +
    +

    the section index for the object. Using a sectionIndex with an invalid range will return nil.

    +
    +
    + + itemIndex + + +
    +

    the index for the object within the section. Using an itemIndex with an invalid range will return nil.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject at the specified section and item index, or nil if out of bounds

    +
    +
    +
    +
  • +
  • +
    + + + + objectAtIndexPath(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the object at the given NSIndexPath. This subscript indexer is typically used for CSListMonitors created as sectioned lists.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func objectAtIndexPath(_ indexPath: IndexPath) -> Any
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + indexPath + + +
    +

    the NSIndexPath for the object. Using an indexPath with an invalid range will raise an exception.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject at the specified index path

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the object at the given NSIndexPath, or nil if out of bounds. This subscript indexer is typically used for CSListMonitors created as sectioned lists.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func objectAtSafeIndexPath(_ indexPath: IndexPath) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + indexPath + + +
    +

    the NSIndexPath for the object. Using an indexPath with an invalid range will return nil.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject at the specified index path, or nil if out of bounds

    +
    +
    +
    +
  • +
  • +
    + + + + hasObjects() + +
    +
    +
    +
    +
    +
    +

    Checks if the CSListMonitor has at least one object in any section.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func hasObjects() -> Bool
    + +
    +
    +
    +

    Return Value

    +

    YES if at least one object in any section exists, NO otherwise

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Checks if the CSListMonitor has at least one object the specified section.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func hasObjectsInSection(_ section: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will return NO.

    +
    +
    +
    +
    +

    Return Value

    +

    YES if at least one object in the specified section exists, NO otherwise

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns all objects in all sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func objectsInAllSections() -> [NSManagedObject]
    + +
    +
    +
    +

    Return Value

    +

    all objects in all sections

    +
    +
    +
    +
  • +
  • +
    + + + + objectsInSection(_:) + +
    +
    +
    +
    +
    +
    +

    Returns all objects in the specified section

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func objectsInSection(_ section: Int) -> [NSManagedObject]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will raise an exception.

    +
    +
    +
    +
    +

    Return Value

    +

    all objects in the specified section

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns all objects in the specified section, or nil if out of bounds.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func objectsInSafeSection(safeSectionIndex section: Int) -> [NSManagedObject]?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will return nil.

    +
    +
    +
    +
    +

    Return Value

    +

    all objects in the specified section, or nil if out of bounds

    +
    +
    +
    +
  • +
  • +
    + + + + numberOfSections() + +
    +
    +
    +
    +
    +
    +

    Returns the number of sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func numberOfSections() -> Int
    + +
    +
    +
    +

    Return Value

    +

    the number of sections

    +
    +
    +
    +
  • +
  • +
    + + + + numberOfObjects() + +
    +
    +
    +
    +
    +
    +

    Returns the number of objects in all sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func numberOfObjects() -> Int
    + +
    +
    +
    +

    Return Value

    +

    the number of objects in all sections

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the number of objects in the specified section

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func numberOfObjectsInSection(_ section: Int) -> Int
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will raise an exception.

    +
    +
    +
    +
    +

    Return Value

    +

    the number of objects in the specified section

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the number of objects in the specified section, or nil if out of bounds.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func numberOfObjectsInSafeSection(safeSectionIndex section: Int) -> NSNumber?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will return nil.

    +
    +
    +
    +
    +

    Return Value

    +

    the number of objects in the specified section, or nil if out of bounds

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the NSFetchedResultsSectionInfo for the specified section

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func sectionInfoAtIndex(_ section: Int) -> NSFetchedResultsSectionInfo
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will raise an exception.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSFetchedResultsSectionInfo for the specified section

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the NSFetchedResultsSectionInfo for the specified section, or nil if out of bounds.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func sectionInfoAtSafeSectionIndex(safeSectionIndex section: Int) -> NSFetchedResultsSectionInfo?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will return nil.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSFetchedResultsSectionInfo for the specified section, or nil if the section index is out of bounds.

    +
    +
    +
    +
  • +
  • +
    + + + + sections() + +
    +
    +
    +
    +
    +
    +

    Returns the NSFetchedResultsSectionInfos for all sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func sections() -> [NSFetchedResultsSectionInfo]
    + +
    +
    +
    +

    Return Value

    +

    the NSFetchedResultsSectionInfos for all sections

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the target section for a specified Section Index title and index.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func targetSectionForSectionIndexTitle(title: String, index: Int) -> Int
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + title + + +
    +

    the title of the Section Index

    +
    +
    + + index + + +
    +

    the index of the Section Index

    +
    +
    +
    +
    +

    Return Value

    +

    the target section for the specified Section Index title and index.

    +
    +
    +
    +
  • +
  • +
    + + + + sectionIndexTitles() + +
    +
    +
    +
    +
    +
    +

    Returns the section index titles for all sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func sectionIndexTitles() -> [String]
    + +
    +
    +
    +

    Return Value

    +

    the section index titles for all sections

    +
    +
    +
    +
  • +
  • +
    + + + + indexOf(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the index of the NSManagedObject if it exists in the CSListMonitor‘s fetched objects, or nil if not found.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func indexOf(_ object: NSManagedObject) -> NSNumber?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject to search the index of

    +
    +
    +
    +
    +

    Return Value

    +

    the index of the NSManagedObject if it exists in the CSListMonitor‘s fetched objects, or nil if not found.

    +
    +
    +
    +
  • +
  • +
    + + + + indexPathOf(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the NSIndexPath of the NSManagedObject if it exists in the CSListMonitor‘s fetched objects, or nil if not found.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func indexPathOf(_ object: NSManagedObject) -> IndexPath?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject to search the index of

    +
    +
    +
    +
    +

    Return Value

    +

    the NSIndexPath of the NSManagedObject if it exists in the ListMonitor‘s fetched objects, or nil if not found.

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + addListObserver(_:) + +
    +
    +
    +
    +
    +
    +

    Registers a CSListObserver to be notified when changes to the receiver’s list occur.

    + +

    To prevent retain-cycles, CSListMonitor only keeps weak references to its observers.

    + +

    For thread safety, this method needs to be called from the main thread. An assertion failure will occur (on debug builds only) if called from any thread other than the main thread.

    + +

    Calling -addListObserver: multiple times on the same observer is safe, as CSListMonitor unregisters previous notifications to the observer before re-registering them.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func addListObserver(_ observer: CSListObserver)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + observer + + +
    +

    a CSListObserver to send change notifications to

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Registers a CSListObjectObserver to be notified when changes to the receiver’s list occur.

    + +

    To prevent retain-cycles, CSListMonitor only keeps weak references to its observers.

    + +

    For thread safety, this method needs to be called from the main thread. An assertion failure will occur (on debug builds only) if called from any thread other than the main thread.

    + +

    Calling -addListObjectObserver: multiple times on the same observer is safe, as ListMonitor unregisters previous notifications to the observer before re-registering them.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func addListObjectObserver(_ observer: CSListObjectObserver)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + observer + + +
    +

    a CSListObjectObserver to send change notifications to

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Registers a CSListSectionObserver to be notified when changes to the receiver’s list occur.

    + +

    To prevent retain-cycles, CSListMonitor only keeps weak references to its observers.

    + +

    For thread safety, this method needs to be called from the main thread. An assertion failure will occur (on debug builds only) if called from any thread other than the main thread.

    + +

    Calling -addListSectionObserver: multiple times on the same observer is safe, as ListMonitor unregisters previous notifications to the observer before re-registering them.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func addListSectionObserver(_ observer: CSListSectionObserver)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + observer + + +
    +

    a CSListSectionObserver to send change notifications to

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Unregisters a CSListObserver from receiving notifications for changes to the receiver’s list.

    + +

    For thread safety, this method needs to be called from the main thread. An assertion failure will occur (on debug builds only) if called from any thread other than the main thread.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func removeListObserver(_ observer: CSListObserver)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + observer + + +
    +

    a CSListObserver to unregister notifications to

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + isPendingRefetch + +
    +
    +
    +
    +
    +
    +

    Returns YES if a call to -refetch: was made to the CSListMonitor and is currently waiting for the fetching to complete. Returns NO otherwise.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var isPendingRefetch: Bool { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + refetch(_:) + +
    +
    +
    +
    +
    +
    +

    Asks the CSListMonitor to refetch its objects using the specified series of CSFetchClauses. Note that this method does not execute the fetch immediately; the actual fetching will happen after the NSFetchedResultsController‘s last controllerDidChangeContent(_:) notification completes.

    + +

    refetch(...) broadcasts listMonitorWillRefetch(...) to its observers immediately, and then listMonitorDidRefetch(...) after the new fetch request completes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func refetch(_ fetchClauses: [CSFetchClause])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses. Note that only specified clauses will be changed; unspecified clauses will use previous values.

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CSMigrationResult.html b/docs/Classes/CSMigrationResult.html new file mode 100644 index 0000000..9039352 --- /dev/null +++ b/docs/Classes/CSMigrationResult.html @@ -0,0 +1,1128 @@ + + + + CSMigrationResult Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSMigrationResult

+
+
+
@objc
+public final class CSMigrationResult : NSObject, CoreStoreObjectiveCType
+ +
+
+

The CSMigrationResult serves as the Objective-C bridging type for MigrationResult.

+
+

See also

+ MigrationResult + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + isSuccess + +
    +
    +
    +
    +
    +
    +

    YES if the migration succeeded, NO otherwise

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var isSuccess: Bool { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + isFailure + +
    +
    +
    +
    +
    +
    +

    YES if the migration failed, NO otherwise

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var isFailure: Bool { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + migrationTypes + +
    +
    +
    +
    +
    +
    +

    YES if the migration succeeded, NO otherwise

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var migrationTypes: [CSMigrationType]? { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + error + +
    +
    +
    +
    +
    +
    +

    The NSError for a failed migration, or nil if the migration succeeded

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var error: NSError? { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    If the result was a success, the success block is executed with an array of CSMigrationTypes that indicates the migration steps completed. If the result was a failure, the failure block is executed with an NSError argument pertaining to the actual error.

    + +

    The blocks are executed immediately as @noescape and will not be retained.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func handleSuccess(_ success: (_ migrationTypes: [CSMigrationType]) -> Void, failure: (_ error: NSError) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + success + + +
    +

    the block to execute on success. The block passes an array of CSMigrationTypes that indicates the migration steps completed.

    +
    +
    + + failure + + +
    +

    the block to execute on failure. The block passes an NSError argument that pertains to the actual error.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + handleSuccess(_:) + +
    +
    +
    +
    +
    +
    +

    If the result was a success, the success block is executed with an array of CSMigrationTypes that indicates the migration steps completed. If the result was a failure, this method does nothing.

    + +

    The block is executed immediately as @noescape and will not be retained.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func handleSuccess(_ success: (_ migrationTypes: [CSMigrationType]) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + success + + +
    +

    the block to execute on success. The block passes an array of CSMigrationTypes that indicates the migration steps completed.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + handleFailure(_:) + +
    +
    +
    +
    +
    +
    +

    If the result was a failure, the failure block is executed with an NSError argument pertaining to the actual error. If the result was a success, this method does nothing.

    + +

    The block is executed immediately as @noescape and will not be retained.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func handleFailure(_ failure: (_ error: NSError) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + failure + + +
    +

    the block to execute on failure. The block passes an NSError argument that pertains to the actual error.

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + bridgeToSwift + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let bridgeToSwift: MigrationResult
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init(_ swiftValue: MigrationResult)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CSMigrationType.html b/docs/Classes/CSMigrationType.html new file mode 100644 index 0000000..681b658 --- /dev/null +++ b/docs/Classes/CSMigrationType.html @@ -0,0 +1,997 @@ + + + + CSMigrationType Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSMigrationType

+
+
+
@objc
+public final class CSMigrationType : NSObject, CoreStoreObjectiveCType
+ +
+
+

The CSMigrationType serves as the Objective-C bridging type for MigrationType.

+
+

See also

+ MigrationType + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + needsMigration + +
    +
    +
    +
    +
    +
    +

    Returns YES if the CSMigrationType‘s sourceVersion and destinationVersion do not match. Returns NO otherwise.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var needsMigration: Bool { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + sourceVersion + +
    +
    +
    +
    +
    +
    +

    Returns the source model version for the migration type. If no migration is required, sourceVersion will be equal to the destinationVersion.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var sourceVersion: String { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + destinationVersion + +
    +
    +
    +
    +
    +
    +

    Returns the destination model version for the migration type. If no migration is required, destinationVersion will be equal to the sourceVersion.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var destinationVersion: String { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns YES if the CSMigrationType is a lightweight migration. Used as syntactic sugar.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var isLightweightMigration: Bool { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns YES if the CSMigrationType is a heavyweight migration. Used as syntactic sugar.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var isHeavyweightMigration: Bool { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + bridgeToSwift + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let bridgeToSwift: MigrationType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init(_ swiftValue: MigrationType)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CSObjectMonitor.html b/docs/Classes/CSObjectMonitor.html new file mode 100644 index 0000000..e6c502b --- /dev/null +++ b/docs/Classes/CSObjectMonitor.html @@ -0,0 +1,949 @@ + + + + CSObjectMonitor Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSObjectMonitor

+
+
+
@available(OSX 10.12, *)
+@objc
+public final class CSObjectMonitor : NSObject
+ +
+
+

The CSObjectMonitor serves as the Objective-C bridging type for ObjectMonitor<T>.

+
+

See also

+ ObjectMonitor + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + object + +
    +
    +
    +
    +
    +
    +

    Returns the NSManagedObject instance being observed, or nil if the object was already deleted.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var object: Any? { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + isObjectDeleted + +
    +
    +
    +
    +
    +
    +

    Returns YES if the NSManagedObject instance being observed still exists, or NO if the object was already deleted.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isObjectDeleted: Bool { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + addObjectObserver(_:) + +
    +
    +
    +
    +
    +
    +

    Registers a CSObjectObserver to be notified when changes to the receiver’s object are made.

    + +

    To prevent retain-cycles, CSObjectMonitor only keeps weak references to its observers.

    + +

    For thread safety, this method needs to be called from the main thread. An assertion failure will occur (on debug builds only) if called from any thread other than the main thread.

    + +

    Calling -addObjectObserver: multiple times on the same observer is safe, as CSObjectMonitor unregisters previous notifications to the observer before re-registering them.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func addObjectObserver(_ observer: CSObjectObserver)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + observer + + +
    +

    an CSObjectObserver to send change notifications to

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Unregisters an CSObjectObserver from receiving notifications for changes to the receiver’s object.

    + +

    For thread safety, this method needs to be called from the main thread. An assertion failure will occur (on debug builds only) if called from any thread other than the main thread.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func removeObjectObserver(_ observer: CSObjectObserver)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + observer + + +
    +

    an CSObjectObserver to unregister notifications to

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CSOrderBy.html b/docs/Classes/CSOrderBy.html new file mode 100644 index 0000000..2cff801 --- /dev/null +++ b/docs/Classes/CSOrderBy.html @@ -0,0 +1,924 @@ + + + + CSOrderBy Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSOrderBy

+
+
+
@objc
+public final class CSOrderBy : NSObject, CSFetchClause, CSQueryClause, CSDeleteClause
+ +
+
+

The CSOrderBy serves as the Objective-C bridging type for OrderBy.

+
+

See also

+ OrderBy + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + sortDescriptors + +
    +
    +
    +
    +
    +
    +

    The list of sort descriptors

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var sortDescriptors: [NSSortDescriptor] { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(sortDescriptor:) + +
    +
    +
    +
    +
    +
    +

    Initializes a CSOrderBy clause with a single sort descriptor

    +
    MyPersonEntity *people = [transaction
    +   fetchAllFrom:CSFromClass([MyPersonEntity class])
    +   fetchClauses:@[CSOrderByKey(CSSortAscending(@"fullname"))]]];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(sortDescriptor: NSSortDescriptor)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sortDescriptor + + +
    +

    a NSSortDescriptor

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a CSOrderBy clause with a list of sort descriptors

    +
    MyPersonEntity *people = [transaction
    +   fetchAllFrom:CSFromClass([MyPersonEntity class])
    +   fetchClauses:@[CSOrderByKeys(CSSortAscending(@"fullname"), CSSortDescending(@"age"), nil))]]];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(sortDescriptors: [NSSortDescriptor])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sortDescriptors + + +
    +

    an array of NSSortDescriptors

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CSSQLiteStore.html b/docs/Classes/CSSQLiteStore.html new file mode 100644 index 0000000..8437259 --- /dev/null +++ b/docs/Classes/CSSQLiteStore.html @@ -0,0 +1,1250 @@ + + + + CSSQLiteStore Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSSQLiteStore

+
+
+
@objc
+public final class CSSQLiteStore : NSObject, CSLocalStorage, CoreStoreObjectiveCType
+ +
+
+

The CSSQLiteStore serves as the Objective-C bridging type for SQLiteStore.

+
+

See also

+ SQLiteStore + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes an SQLite store interface from the given SQLite file URL. When this instance is passed to the CSDataStack‘s -addStorage*: methods, a new SQLite file will be created if it does not exist.

    +
    +

    Important

    + Initializing CSSQLiteStores with custom migration mapping models is currently not supported. Create an SQLiteStore instance from Swift code and bridge the instance to Objective-C using its SQLiteStore.bridgeToObjectiveC property. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(fileURL: URL, configuration: ModelConfiguration, localStorageOptions: Int)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + fileURL + + +
    +

    the local file URL for the target SQLite persistent store. Note that if you have multiple configurations, you will need to specify a different fileURL explicitly for each of them.

    +
    +
    + + configuration + + +
    +

    an optional configuration name from the model file. If not specified, defaults to nil, the Default configuration. Note that if you have multiple configurations, you will need to specify a different fileURL explicitly for each of them.

    +
    +
    + + localStorageOptions + + +
    +

    When the CSSQLiteStore is passed to the CSDataStack‘s addStorage() methods, tells the CSDataStack how to setup the persistent store. Defaults to CSLocalStorageOptionsNone.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes an SQLite store interface from the given SQLite file name. When this instance is passed to the CSDataStack‘s -addStorage*: methods, a new SQLite file will be created if it does not exist.

    +
    +

    Important

    + Initializing CSSQLiteStores with custom migration mapping models is currently not supported. Create an SQLiteStore instance from Swift code and bridge the instance to Objective-C using its SQLiteStore.bridgeToObjectiveC property. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(fileName: String, configuration: ModelConfiguration, localStorageOptions: Int)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + fileName + + +
    +

    the local filename for the SQLite persistent store in the Application Support/ directory (or the Caches/ directory on tvOS). Note that if you have multiple configurations, you will need to specify a different fileName explicitly for each of them.

    +
    +
    + + configuration + + +
    +

    an optional configuration name from the model file. If not specified, defaults to nil, the Default configuration. Note that if you have multiple configurations, you will need to specify a different fileName explicitly for each of them.

    +
    +
    + + localStorageOptions + + +
    +

    When the CSSQLiteStore is passed to the CSDataStack‘s addStorage() methods, tells the CSDataStack how to setup the persistent store. Defaults to [CSLocalStorageOptions none].

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes an CSSQLiteStore with an all-default settings: a fileURL pointing to a .sqlite file in the Application Support/ directory (or the Caches/ directory on tvOS), a nil configuration pertaining to the Default configuration, and localStorageOptions set to [CSLocalStorageOptions none].

    +
    +

    Important

    + Initializing CSSQLiteStores with custom migration mapping models is currently not supported. Create an SQLiteStore instance from Swift code and bridge the instance to Objective-C using its SQLiteStore.bridgeToObjectiveC property. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience override init()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fileURL + +
    +
    +
    +
    +
    +
    +

    The NSURL that points to the SQLite file

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var fileURL: URL { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    An array of SchemaMappingProviders that provides the complete mapping models for custom migrations. This is currently only supported for Swift code.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var migrationMappingProviders: [Any] { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + localStorageOptions + +
    +
    +
    +
    +
    +
    +

    Options that tell the CSDataStack how to setup the persistent store

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var localStorageOptions: Int { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + storeType + +
    +
    +
    +
    +
    +
    +

    The string identifier for the NSPersistentStore‘s type property. For CSSQLiteStores, this is always set to NSSQLiteStoreType.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static let storeType: String
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    +

    The configuration name in the model file

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var configuration: ModelConfiguration { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + storeOptions + +
    +
    +
    +
    +
    +
    +

    The options dictionary for the NSPersistentStore. For CSSQLiteStores, this is always set to

    +
    [NSSQLitePragmasOption: ["journal_mode": "WAL"]]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var storeOptions: [AnyHashable : Any]? { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Called by the CSDataStack to perform actual deletion of the store file from disk. Do not call directly! The sourceModel argument is a hint for the existing store’s model version. For CSSQLiteStore, this converts the database’s WAL journaling mode to DELETE before deleting the file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func cs_eraseStorageAndWait(metadata: NSDictionary, soureModelHint: NSManagedObjectModel?, error: NSErrorPointer) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + bridgeToSwift + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let bridgeToSwift: SQLiteStore
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init(_ swiftValue: SQLiteStore)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CSSectionBy.html b/docs/Classes/CSSectionBy.html new file mode 100644 index 0000000..06c207f --- /dev/null +++ b/docs/Classes/CSSectionBy.html @@ -0,0 +1,909 @@ + + + + CSSectionBy Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSSectionBy

+
+
+
@available(OSX 10.12, *)
+@objc
+public final class CSSectionBy : NSObject
+ +
+
+

The CSSectionBy serves as the Objective-C bridging type for SectionBy.

+
+

See also

+ SectionBy + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + keyPath(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a CSSectionBy clause with the key path to use to group CSListMonitor objects into sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func keyPath(_ sectionKeyPath: KeyPathString) -> CSSectionBy
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sectionKeyPath + + +
    +

    the key path to use to group the objects into sections

    +
    +
    +
    +
    +

    Return Value

    +

    a CSSectionBy clause with the key path to use to group CSListMonitor objects into sections

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a CSSectionBy clause with the key path to use to group CSListMonitor objects into sections, and a closure to transform the value for the key path to an appropriate section name

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func keyPath(_ sectionKeyPath: KeyPathString, sectionIndexTransformer: @escaping (_ sectionName: String?) -> String?) -> CSSectionBy
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionKeyPath + + +
    +

    the key path to use to group the objects into sections

    +
    +
    + + sectionIndexTransformer + + +
    +

    a closure to transform the value for the key path to an appropriate section name

    +
    +
    +
    +
    +

    Return Value

    +

    a CSSectionBy clause with the key path to use to group CSListMonitor objects into sections

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CSSelect.html b/docs/Classes/CSSelect.html new file mode 100644 index 0000000..5b6b08b --- /dev/null +++ b/docs/Classes/CSSelect.html @@ -0,0 +1,1200 @@ + + + + CSSelect Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSSelect

+
+
+
@objc
+public final class CSSelect : NSObject
+ +
+
+

The CSSelect serves as the Objective-C bridging type for Select.

+
+

See also

+ Select + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + init(numberTerm:) + +
    +
    +
    +
    +
    +
    +

    Creates a CSSelect clause for querying NSNumber values.

    +
    NSNumber *maxAge = [CSCoreStore
    +   queryValueFrom:CSFromClass([MyPersonEntity class])
    +   select:CSSelectNumber(CSAggregateMax(@"age"))
    +   // ...
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(numberTerm: CSSelectTerm)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + numberTerm + + +
    +

    the CSSelectTerm specifying the attribute/aggregate value to query

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(decimalTerm:) + +
    +
    +
    +
    +
    +
    +

    Creates a CSSelect clause for querying NSDecimalNumber values.

    +
    NSDecimalNumber *averagePrice = [CSCoreStore
    +   queryValueFrom:CSFromClass([MyPersonEntity class])
    +   select:CSSelectDecimal(CSAggregateAverage(@"price"))
    +   // ...
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(decimalTerm: CSSelectTerm)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + decimalTerm + + +
    +

    the CSSelectTerm specifying the attribute/aggregate value to query

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(stringTerm:) + +
    +
    +
    +
    +
    +
    +

    Creates a CSSelect clause for querying NSString values.

    +
    NSString *fullname = [CSCoreStore
    +   queryValueFrom:CSFromClass([MyPersonEntity class])
    +   select:CSSelectString(CSAttribute(@"fullname"))
    +   // ...
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(stringTerm: CSSelectTerm)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + stringTerm + + +
    +

    the CSSelectTerm specifying the attribute/aggregate value to query

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(dateTerm:) + +
    +
    +
    +
    +
    +
    +

    Creates a CSSelect clause for querying NSDate values.

    +
    NSDate *lastUpdate = [CSCoreStore
    +   queryValueFrom:CSFromClass([MyPersonEntity class])
    +   select:CSSelectDate(CSAggregateMax(@"updatedDate"))
    +   // ...
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(dateTerm: CSSelectTerm)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + dateTerm + + +
    +

    the CSSelectTerm specifying the attribute/aggregate value to query

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(dataTerm:) + +
    +
    +
    +
    +
    +
    +

    Creates a CSSelect clause for querying NSData values.

    +
    NSData *imageData = [CSCoreStore
    +   queryValueFrom:CSFromClass([MyPersonEntity class])
    +   select:CSSelectData(CSAttribute(@"imageData"))
    +   // ...
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(dataTerm: CSSelectTerm)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + dataTerm + + +
    +

    the CSSelectTerm specifying the attribute/aggregate value to query

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(objectIDTerm:) + +
    +
    +
    +
    +
    +
    +

    Creates a CSSelect clause for querying NSManagedObjectID values.

    +
    NSManagedObjectID *objectID = [CSCoreStore
    +   queryValueFrom:CSFromClass([MyPersonEntity class])
    +   select:CSSelectObjectID()
    +   // ...
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(objectIDTerm: ())
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + dictionaryForTerm(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a CSSelect clause for querying NSDictionary of an entity’s attribute keys and values.

    +
    NSDictionary *keyValues = [CSCoreStore
    +    queryValueFrom:[CSFrom entityClass:[MyPersonEntity class]]
    +    select:[CSSelect dictionaryForTerm:[CSSelectTerm maximum:@"age" as:nil]]];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func dictionaryForTerm(_ term: CSSelectTerm) -> CSSelect
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + term + + +
    +

    the CSSelectTerm specifying the attribute/aggregate value to query

    +
    +
    +
    +
    +

    Return Value

    +

    a CSSelect clause for querying an entity attribute

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a CSSelect clause for querying NSDictionary of an entity’s attribute keys and values.

    +
    NSDictionary *keyValues = [CSCoreStore
    +    queryValueFrom:[CSFrom entityClass:[MyPersonEntity class]]
    +    select:[CSSelect dictionaryForTerms:@[
    +        [CSSelectTerm attribute:@"name" as:nil],
    +        [CSSelectTerm attribute:@"age" as:nil]
    +    ]]];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func dictionaryForTerms(_ terms: [CSSelectTerm]) -> CSSelect
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + terms + + +
    +

    the CSSelectTerms specifying the attribute/aggregate values to query

    +
    +
    +
    +
    +

    Return Value

    +

    a CSSelect clause for querying an entity attribute

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CSSelectTerm.html b/docs/Classes/CSSelectTerm.html new file mode 100644 index 0000000..456f6cb --- /dev/null +++ b/docs/Classes/CSSelectTerm.html @@ -0,0 +1,1225 @@ + + + + CSSelectTerm Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSSelectTerm

+
+
+
@objc
+public final class CSSelectTerm : NSObject
+ +
+
+

The CSSelectTerm serves as the Objective-C bridging type for SelectTerm.

+
+

See also

+ SelectTerm + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + init(keyPath:) + +
    +
    +
    +
    +
    +
    +

    Provides a CSSelectTerm to a CSSelect clause for querying an entity attribute.

    +
    NSString *fullName = [CSCoreStore
    +    queryValueFrom:[CSFrom entityClass:[MyPersonEntity class]]
    +    select:CSSelectString(CSAttribute(@"fullname"))
    +    fetchClauses:@[[CSWhere keyPath:@"employeeID" isEqualTo: @1111]]];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(keyPath: KeyPathString)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + average(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a CSSelectTerm to a CSSelect clause for querying the average value of an attribute.

    +
    NSNumber *averageAge = [CSCoreStore
    +    queryValueFrom:[CSFrom entityClass:[MyPersonEntity class]]
    +    select:[CSSelect numberForTerm:[CSSelectTerm average:@"age" as:nil]]];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func average(_ keyPath: KeyPathString, as alias: KeyPathString?) -> CSSelectTerm
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    +
    +
    +

    Return Value

    +

    a CSSelectTerm to a CSSelect clause for querying the average value of an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + count(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a CSSelectTerm to a CSSelect clause for a count query.

    +
    NSNumber *numberOfEmployees = [CSCoreStore
    +    queryValueFrom:[CSFrom entityClass:[MyPersonEntity class]]
    +    select:[CSSelect numberForTerm:[CSSelectTerm count:@"employeeID" as:nil]]];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func count(_ keyPath: KeyPathString, as alias: KeyPathString?) -> CSSelectTerm
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key count() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for a count query

    +
    +
    +
    +
  • +
  • +
    + + + + maximum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a CSSelectTerm to a CSSelect clause for querying the maximum value for an attribute.

    +
    NSNumber *maximumAge = [CSCoreStore
    +    queryValueFrom:[CSFrom entityClass:[MyPersonEntity class]]
    +    select:[CSSelect numberForTerm:[CSSelectTerm maximum:@"age" as:nil]]];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func maximum(_ keyPath: KeyPathString, as alias: KeyPathString?) -> CSSelectTerm
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key max() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a CSSelectTerm to a CSSelect clause for querying the maximum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + minimum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a CSSelectTerm to a CSSelect clause for querying the minimum value for an attribute.

    +
    NSNumber *minimumAge = [CSCoreStore
    +    queryValueFrom:[CSFrom entityClass:[MyPersonEntity class]]
    +    select:[CSSelect numberForTerm:[CSSelectTerm minimum:@"age" as:nil]]];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func minimum(_ keyPath: KeyPathString, as alias: KeyPathString?) -> CSSelectTerm
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key min() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a CSSelectTerm to a CSSelect clause for querying the minimum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + sum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a CSSelectTerm to a CSSelect clause for querying the sum value for an attribute.

    +
    NSNumber *totalAge = [CSCoreStore
    +    queryValueFrom:[CSFrom entityClass:[MyPersonEntity class]]
    +    select:[CSSelect numberForTerm:[CSSelectTerm sum:@"age" as:nil]]];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func sum(_ keyPath: KeyPathString, as alias: KeyPathString?) -> CSSelectTerm
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key sum() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a CSSelectTerm to a CSSelect clause for querying the sum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + objectIDAs(_:) + +
    +
    +
    +
    +
    +
    +

    Provides a CSSelectTerm to a CSSelect clause for querying the NSManagedObjectID.

    +
    NSManagedObjectID *objectID = [CSCoreStore
    +    queryValueFrom:[CSFrom entityClass:[MyPersonEntity class]]
    +    select:[CSSelect objectIDForTerm:[CSSelectTerm objectIDAs:nil]]
    +    fetchClauses:@[[CSWhere keyPath:@"employeeID" isEqualTo: @1111]]];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func objectIDAs(_ alias: KeyPathString? = nil) -> CSSelectTerm
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key objecID is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the sum value for an attribute

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CSSetupResult.html b/docs/Classes/CSSetupResult.html new file mode 100644 index 0000000..15d7e8f --- /dev/null +++ b/docs/Classes/CSSetupResult.html @@ -0,0 +1,1065 @@ + + + + CSSetupResult Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSSetupResult

+
+
+
@objc
+public final class CSSetupResult : NSObject
+ +
+
+

The CSSetupResult serves as the Objective-C bridging type for SetupResult.

+
+

See also

+ SetupResult + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + isSuccess + +
    +
    +
    +
    +
    +
    +

    YES if adding the CSStorageInterface to the CSDataStack succeeded, NO otherwise.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var isSuccess: Bool { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + isFailure + +
    +
    +
    +
    +
    +
    +

    YES if adding the CSStorageInterface to the CSDataStack failed, NO otherwise. When YES, the error property returns the actual NSError for the failure.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var isFailure: Bool { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + storage + +
    +
    +
    +
    +
    +
    +

    A CSStorageInterface instance if the commit operation for the transaction succeeded. Returns nil otherwise.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public let storage: CSStorageInterface?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + error + +
    +
    +
    +
    +
    +
    +

    The NSError for a failed commit operation, or nil if the commit succeeded

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public let error: NSError?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    If the result was a success, the success block is executed with the CSStorageInterface instance that was added to the CSDataStack. If the result was a failure, the failure block is executed with an NSError argument pertaining to the actual error.

    + +

    The blocks are executed immediately as @noescape and will not be retained.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func handleSuccess(_ success: (_ storage: CSStorageInterface) -> Void, failure: (_ error: NSError) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + success + + +
    +

    the block to execute on success. The block passes a CSStorageInterface instance that was added to the CSDataStack.

    +
    +
    + + failure + + +
    +

    the block to execute on failure. The block passes an NSError argument that pertains to the actual error.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + handleSuccess(_:) + +
    +
    +
    +
    +
    +
    +

    If the result was a success, the success block is executed with a BOOL argument that indicates if there were any changes made. If the result was a failure, this method does nothing.

    + +

    The block is executed immediately as @noescape and will not be retained.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func handleSuccess(_ success: (_ storage: CSStorageInterface) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + success + + +
    +

    the block to execute on success. The block passes a BOOL argument that indicates if there were any changes made.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + handleFailure(_:) + +
    +
    +
    +
    +
    +
    +

    If the result was a failure, the failure block is executed with an NSError argument pertaining to the actual error. If the result was a success, this method does nothing.

    + +

    The block is executed immediately as @noescape and will not be retained.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func handleFailure(_ failure: (_ error: NSError) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + failure + + +
    +

    the block to execute on failure. The block passes an NSError argument that pertains to the actual error.

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CSSynchronousDataTransaction.html b/docs/Classes/CSSynchronousDataTransaction.html new file mode 100644 index 0000000..bea2862 --- /dev/null +++ b/docs/Classes/CSSynchronousDataTransaction.html @@ -0,0 +1,1203 @@ + + + + CSSynchronousDataTransaction Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSSynchronousDataTransaction

+
+
+
@objc
+public final class CSSynchronousDataTransaction : CSBaseDataTransaction, CoreStoreObjectiveCType
+ +
+
+

The CSSynchronousDataTransaction serves as the Objective-C bridging type for SynchronousDataTransaction.

+
+

See also

+ SynchronousDataTransaction + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + commitAndWait(error:) + +
    +
    +
    +
    +
    +
    +

    Saves the transaction changes and waits for completion synchronously. This method should not be used after the -commitAndWaitWithError: method was already called once.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func commitAndWait(error: NSErrorPointer) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + error + + +
    +

    the CSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    YES if the commit succeeded, NO if the commit failed. If NO, the error argument will hold error information.

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + createInto(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a new NSManagedObject with the specified entity type.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public override func createInto(_ into: CSInto) -> Any
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + into + + +
    +

    the CSInto clause indicating the destination NSManagedObject entity type and the destination configuration

    +
    +
    +
    +
    +

    Return Value

    +

    a new NSManagedObject instance of the specified entity type.

    +
    +
    +
    +
  • +
  • +
    + + + + editObject(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an editable proxy of a specified NSManagedObject. This method should not be used after the -commitAndWait method was already called once.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public override func editObject(_ object: NSManagedObject?) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject type to be edited

    +
    +
    +
    +
    +

    Return Value

    +

    an editable proxy for the specified NSManagedObject.

    +
    +
    +
    +
  • +
  • +
    + + + + editInto(_:objectID:) + +
    +
    +
    +
    +
    +
    +

    Returns an editable proxy of the object with the specified NSManagedObjectID. This method should not be used after the -commitAndWait method was already called once.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public override func editInto(_ into: CSInto, objectID: NSManagedObjectID) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + into + + +
    +

    a CSInto clause specifying the entity type

    +
    +
    + + objectID + + +
    +

    the NSManagedObjectID for the object to be edited

    +
    +
    +
    +
    +

    Return Value

    +

    an editable proxy for the specified NSManagedObject.

    +
    +
    +
    +
  • +
  • +
    + + + + deleteObject(_:) + +
    +
    +
    +
    +
    +
    +

    Deletes a specified NSManagedObject. This method should not be used after the -commitAndWait method was already called once.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public override func deleteObject(_ object: NSManagedObject?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject type to be deleted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + deleteObjects(_:) + +
    +
    +
    +
    +
    +
    +

    Deletes the specified NSManagedObjects.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override func deleteObjects(_ objects: [NSManagedObject])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objects + + +
    +

    the NSManagedObjects to be deleted

    +
    +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CSTweak.html b/docs/Classes/CSTweak.html new file mode 100644 index 0000000..45fa3c6 --- /dev/null +++ b/docs/Classes/CSTweak.html @@ -0,0 +1,937 @@ + + + + CSTweak Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSTweak

+
+
+
@objc
+public final class CSTweak : NSObject, CSFetchClause, CSQueryClause, CSDeleteClause, CoreStoreObjectiveCType
+ +
+
+

The CSTweak serves as the Objective-C bridging type for Tweak.

+
+

See also

+ Tweak + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + block + +
    +
    +
    +
    +
    +
    +

    The block to customize the NSFetchRequest

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var block: (_ fetchRequest: NSFetchRequest<NSFetchRequestResult>) -> Void { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(block:) + +
    +
    +
    +
    +
    +
    +

    Initializes a CSTweak clause with a closure where the NSFetchRequest may be configured.

    +
    +

    Important

    + CSTweak‘s closure is executed only just before the fetch occurs, so make sure that any values captured by the closure is not prone to race conditions. Also, some utilities (such as CSListMonitors) may keep CSFetchClauses in memory and may thus introduce retain cycles if reference captures are not handled properly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(block: @escaping (_ fetchRequest: NSFetchRequest<NSFetchRequestResult>) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    the block to customize the NSFetchRequest

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + bridgeToSwift + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let bridgeToSwift: Tweak
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ swiftValue: Tweak)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CSUnsafeDataModelSchema.html b/docs/Classes/CSUnsafeDataModelSchema.html new file mode 100644 index 0000000..eca085e --- /dev/null +++ b/docs/Classes/CSUnsafeDataModelSchema.html @@ -0,0 +1,981 @@ + + + + CSUnsafeDataModelSchema Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSUnsafeDataModelSchema

+
+
+
@objc
+public final class CSUnsafeDataModelSchema : NSObject, CSDynamicSchema, CoreStoreObjectiveCType
+ +
+
+

The CSUnsafeDataModelSchema serves as the Objective-C bridging type for UnsafeDataModelSchema.

+
+

See also

+ UnsafeDataModelSchema + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes a CSUnsafeDataModelSchema from an NSManagedObjectModel.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public required init(modelName: ModelVersion, model: NSManagedObjectModel)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + modelName + + +
    +

    the model version, typically the file name of an *.xcdatamodeld file (without the file extension)

    +
    +
    + + model + + +
    +

    the NSManagedObjectModel

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + modelVersion + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var modelVersion: ModelVersion { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + rawModel() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func rawModel() -> NSManagedObjectModel
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CSUnsafeDataTransaction.html b/docs/Classes/CSUnsafeDataTransaction.html new file mode 100644 index 0000000..f23d3b9 --- /dev/null +++ b/docs/Classes/CSUnsafeDataTransaction.html @@ -0,0 +1,1267 @@ + + + + CSUnsafeDataTransaction Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSUnsafeDataTransaction

+
+
+
@objc
+public final class CSUnsafeDataTransaction : CSBaseDataTransaction, CoreStoreObjectiveCType
+ +
+
+

The CSUnsafeDataTransaction serves as the Objective-C bridging type for UnsafeDataTransaction.

+
+

See also

+ UnsafeDataTransaction + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Saves the transaction changes asynchronously. For a CSUnsafeDataTransaction, multiple commits are allowed, although it is the developer’s responsibility to ensure a reasonable leeway to prevent blocking the main thread.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func commitWithSuccess(_ success: (() -> Void)?, _ failure: ((CSError) -> Void)?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + success + + +
    +

    the block executed if the save succeeds.

    +
    +
    + + failure + + +
    +

    the block executed if the save fails. A CSError is reported as the argument of the block.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + commitAndWait(error:) + +
    +
    +
    +
    +
    +
    +

    Saves the transaction changes and waits for completion synchronously. For a CSUnsafeDataTransaction, multiple commits are allowed, although it is the developer’s responsibility to ensure a reasonable leeway to prevent blocking the main thread.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func commitAndWait(error: NSErrorPointer) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + error + + +
    +

    the CSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    YES if the commit succeeded, NO if the commit failed. If NO, the error argument will hold error information.

    +
    +
    +
    +
  • +
  • +
    + + + + rollback() + +
    +
    +
    +
    +
    +
    +

    Rolls back the transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func rollback()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + undo() + +
    +
    +
    +
    +
    +
    +

    Undo’s the last change made to the transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func undo()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + redo() + +
    +
    +
    +
    +
    +
    +

    Redo’s the last undone change to the transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func redo()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + flush() + +
    +
    +
    +
    +
    +
    +

    Immediately flushes all pending changes to the transaction’s observers. This is useful in conjunction with ListMonitors and ObjectMonitors created from UnsafeDataTransactions used to manage temporary scratch data.

    +
    +

    Important

    + Note that unlike commit(), flush() does not propagate/save updates to the DataStack and the persistent store. However, the flushed changes will be seen by children transactions created further from the current transaction (i.e. through transaction.beginUnsafe()) + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func flush()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + flush(_:) + +
    +
    +
    +
    +
    +
    +

    Flushes all pending changes to the transaction’s observers at the end of the closure‘s execution. This is useful in conjunction with ListMonitors and ObjectMonitors created from UnsafeDataTransactions used to manage temporary scratch data.

    +
    +

    Important

    + Note that unlike commit(), flush() does not propagate/save updates to the DataStack and the persistent store. However, the flushed changes will be seen by children transactions created further from the current transaction (i.e. through transaction.beginUnsafe()) + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func flush(_ block: () -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    the block where changes can be made prior to the flush

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + beginUnsafe() + +
    +
    +
    +
    +
    +
    +

    Begins a child transaction where NSManagedObject creates, updates, and deletes can be made. This is useful for making temporary changes, such as partially filled forms.

    + +

    To support undo methods such as -undo, -redo, and -rollback, use the -beginSafeWithSupportsUndo: method passing YES to the argument. Without undo support, calling those methods will raise an exception.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func beginUnsafe() -> CSUnsafeDataTransaction
    + +
    +
    +
    +

    Return Value

    +

    a CSUnsafeDataTransaction instance where creates, updates, and deletes can be made.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Begins a child transaction where NSManagedObject creates, updates, and deletes can be made. This is useful for making temporary changes, such as partially filled forms.

    + +
      +
    • prameter supportsUndo: -undo, -redo, and -rollback methods are only available when this parameter is YES, otherwise those method will raise an exception. Note that turning on Undo support may heavily impact performance especially on iOS or watchOS where memory is limited.
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func beginUnsafeWithSupportsUndo(_ supportsUndo: Bool) -> CSUnsafeDataTransaction
    + +
    +
    +
    +

    Return Value

    +

    a CSUnsafeDataTransaction instance where creates, updates, and deletes can be made.

    +
    +
    +
    +
  • +
  • +
    + + + + unsafeContext() + +
    +
    +
    +
    +
    +
    +

    Returns the NSManagedObjectContext for this unsafe transaction. Use only for cases where external frameworks need an NSManagedObjectContext instance to work with.

    + +

    Note that it is the developer’s responsibility to ensure the following:

    + +
      +
    • that the CSUnsafeDataTransaction that owns this context should be strongly referenced and prevented from being deallocated during the context’s lifetime
    • +
    • that all saves will be done either through the CSUnsafeDataTransaction‘s -commit: or -commitAndWait method, or by calling -save: manually on the context, its parent, and all other ancestor contexts if there are any.
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func unsafeContext() -> NSManagedObjectContext
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CSWhere.html b/docs/Classes/CSWhere.html new file mode 100644 index 0000000..cf80c42 --- /dev/null +++ b/docs/Classes/CSWhere.html @@ -0,0 +1,1102 @@ + + + + CSWhere Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSWhere

+
+
+
@objc
+public final class CSWhere : NSObject, CSFetchClause, CSQueryClause, CSDeleteClause
+ +
+
+

The CSWhere serves as the Objective-C bridging type for Where.

+
+

See also

+ Where + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + predicate + +
    +
    +
    +
    +
    +
    +

    The internal NSPredicate instance for the Where clause

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var predicate: NSPredicate { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(value:) + +
    +
    +
    +
    +
    +
    +

    Initializes a CSWhere clause with a predicate that always evaluates to the specified boolean value

    +
    MyPersonEntity *people = [transaction
    +   fetchAllFrom:CSFromClass([MyPersonEntity class])
    +   fetchClauses:@[CSWhereValue(YES)]]];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(value: Bool)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + value + + +
    +

    the boolean value for the predicate

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a CSWhere clause with a predicate using the specified string format and arguments

    +
    NSPredicate *predicate = // ...
    +MyPersonEntity *people = [transaction
    +   fetchAllFrom:CSFromClass([MyPersonEntity class])
    +   fetchClauses:@[CSWherePredicate(predicate)]];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(format: String, argumentArray: [NSObject]?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + format + + +
    +

    the format string for the predicate

    +
    +
    + + argumentArray + + +
    +

    the arguments for format

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a CSWhere clause that compares equality

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(keyPath: KeyPathString, isEqualTo value: CoreDataNativeType?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + value + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a CSWhere clause that compares membership

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(keyPath: KeyPathString, isMemberOf list: [CoreDataNativeType])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + list + + +
    +

    the array to check membership of

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(predicate:) + +
    +
    +
    +
    +
    +
    +

    Initializes a CSWhere clause with an NSPredicate

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(predicate: NSPredicate)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + predicate + + +
    +

    the NSPredicate for the fetch or query

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CSXcodeDataModelSchema.html b/docs/Classes/CSXcodeDataModelSchema.html new file mode 100644 index 0000000..25865e6 --- /dev/null +++ b/docs/Classes/CSXcodeDataModelSchema.html @@ -0,0 +1,981 @@ + + + + CSXcodeDataModelSchema Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSXcodeDataModelSchema

+
+
+
@objc
+public final class CSXcodeDataModelSchema : NSObject, CSDynamicSchema, CoreStoreObjectiveCType
+ +
+
+

The CSXcodeDataModelSchema serves as the Objective-C bridging type for XcodeDataModelSchema.

+
+

See also

+ XcodeDataModelSchema + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes an CSXcodeDataModelSchema from an *.xcdatamodeld file URL.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public required init(modelName: ModelVersion, modelVersionFileURL: URL)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + modelName + + +
    +

    the model version, typically the file name of an *.xcdatamodeld file (without the file extension)

    +
    +
    + + modelVersionFileURL + + +
    +

    the file URL that points to the .xcdatamodeld’s momd file.

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + modelVersion + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var modelVersion: ModelVersion { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + rawModel() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func rawModel() -> NSManagedObjectModel
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CoreStoreObject.html b/docs/Classes/CoreStoreObject.html new file mode 100644 index 0000000..70b214e --- /dev/null +++ b/docs/Classes/CoreStoreObject.html @@ -0,0 +1,1283 @@ + + + + CoreStoreObject Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CoreStoreObject

+
+
+
open class CoreStoreObject : DynamicObject, Hashable
+ +
+
+

The CoreStoreObject is an abstract class for creating CoreStore-managed objects that are more type-safe and more convenient than NSManagedObject subclasses. The model entities for CoreStoreObject subclasses are inferred from the Swift declaration themselves; no .xcdatamodeld files are needed. To declare persisted attributes and relationships for the CoreStoreObject subclass, declare properties of type Value.Required<T>, Value.Optional<T> for values, or Relationship.ToOne<T>, Relationship.ToManyOrdered<T>, Relationship.ToManyUnordered<T> for relationships.

+
class Animal: CoreStoreObject {
+    let species = Value.Required<String>("species", initial: "")
+    let nickname = Value.Optional<String>("nickname")
+    let master = Relationship.ToOne<Person>("master")
+}
+
+class Person: CoreStoreObject {
+    let name = Value.Required<String>("name", initial: "")
+    let pet = Relationship.ToOne<Animal>("pet", inverse: { $0.master })
+}
+
+ +

CoreStoreObject entities for a model version should be added to CoreStoreSchema instance.

+
CoreStore.defaultStack = DataStack(
+    CoreStoreSchema(
+        modelVersion: "V1",
+        entities: [
+            Entity<Animal>("Animal"),
+            Entity<Person>("Person")
+        ]
+    )
+)
+
+
+

See also

+ CoreStoreSchema + +
+
+

See also

+ CoreStoreObject.Value + +
+
+

See also

+ CoreStoreObject.Relationship + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + init(rawObject:) + +
    +
    +
    +
    +
    +
    +

    Do not call this directly. This is exposed as public only as a required initializer.

    +
    +

    Important

    + subclasses that need a custom initializer should override both init(_:) and init(asMeta:), and to call their corresponding super implementations. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init(rawObject: NSManagedObject)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(asMeta:) + +
    +
    +
    +
    +
    +
    +

    Do not call this directly. This is exposed as public only as a required initializer.

    +
    +

    Important

    + subclasses that need a custom initializer should override both init(_:) and init(asMeta:), and to call their corresponding super implementations. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init(asMeta: Void)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: CoreStoreObject, rhs: CoreStoreObject) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + fetchSource() + +
    +
    +
    +
    +
    +
    +

    Exposes a FetchableSource that can fetch sibling objects of this CoreStoreObject instance. This may be the DataStack, a BaseDataTransaction, the NSManagedObjectContext itself, or nil if the obejct’s parent is already deallocated.

    +
    +

    Warning

    + Future implementations may change the instance returned by this method depending on the timing or condition that fetchSource() was called. Do not make assumptions that the instance will be a specific instance. If the NSManagedObjectContext instance is desired, use the FetchableSource.unsafeContext() method to get the correct instance. Also, do not assume that the fetchSource() and querySource() return the same instance all the time. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchSource() -> FetchableSource?
    + +
    +
    +
    +

    Return Value

    +

    a FetchableSource that can fetch sibling objects of this CoreStoreObject instance. This may be the DataStack, a BaseDataTransaction, the NSManagedObjectContext itself, or nil if the object’s parent is already deallocated.

    +
    +
    +
    +
  • +
  • +
    + + + + querySource() + +
    +
    +
    +
    +
    +
    +

    Exposes a QueryableSource that can query attributes and aggregate values. This may be the DataStack, a BaseDataTransaction, the NSManagedObjectContext itself, or nil if the obejct’s parent is already deallocated.

    +
    +

    Warning

    + Future implementations may change the instance returned by this method depending on the timing or condition that querySource() was called. Do not make assumptions that the instance will be a specific instance. If the NSManagedObjectContext instance is desired, use the QueryableSource.unsafeContext() method to get the correct instance. Also, do not assume that the fetchSource() and querySource() return the same instance all the time. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func querySource() -> QueryableSource?
    + +
    +
    +
    +

    Return Value

    +

    a QueryableSource that can query attributes and aggregate values. This may be the DataStack, a BaseDataTransaction, the NSManagedObjectContext itself, or nil if the object’s parent is already deallocated.

    +
    +
    +
    +
  • +
  • +
    + + + + refreshAsFault() + +
    +
    +
    +
    +
    +
    +

    Re-faults the object to use the latest values from the persistent store

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func refreshAsFault()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + refreshAndMerge() + +
    +
    +
    +
    +
    +
    +

    Re-faults the object to use the latest values from the persistent store and merges previously pending changes back

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func refreshAndMerge()
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class func cs_forceCreate(entityDescription: NSEntityDescription, into context: NSManagedObjectContext, assignTo store: NSPersistentStore) -> Self
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_fromRaw(object:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class func cs_fromRaw(object: NSManagedObject) -> Self
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_matches(object:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func cs_matches(object: NSManagedObject) -> Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_id() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cs_id() -> NSManagedObjectID
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_toRaw() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cs_toRaw() -> NSManagedObject
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CoreStoreObjectObjectDiff.html b/docs/Classes/CoreStoreObjectObjectDiff.html new file mode 100644 index 0000000..31053d9 --- /dev/null +++ b/docs/Classes/CoreStoreObjectObjectDiff.html @@ -0,0 +1,896 @@ + + + + CoreStoreObjectObjectDiff Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CoreStoreObjectObjectDiff

+
+
+
public final class CoreStoreObjectObjectDiff<D> where D : CoreStoreObject
+ +
+
+

The object containing the changeset for an observed RelationshipContainer.ToOne property.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + kind + +
    +
    +
    +
    +
    +
    +

    Indicates the kind of change. See the comments for NSObject.observeValue(forKeyPath:of:change:context:) for more information.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let kind: NSKeyValueChange
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + newValue + +
    +
    +
    +
    +
    +
    +

    newValue and oldValue will only be non-nil if .new/.old is passed to observe(). In general, get the most up to date value by accessing it directly on the observed object instead.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) lazy var newValue: D? { get set }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + oldValue + +
    +
    +
    +
    +
    +
    +

    newValue and oldValue will only be non-nil if .new/.old is passed to observe(). In general, get the most up to date value by accessing it directly on the observed object instead.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) lazy var oldValue: D? { get set }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + isPrior + +
    +
    +
    +
    +
    +
    +

    ‘isPrior’ will be true if this change observation is being sent before the change happens, due to .prior being passed to observe()

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let isPrior: Bool
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CoreStoreObjectOrderedDiff.html b/docs/Classes/CoreStoreObjectOrderedDiff.html new file mode 100644 index 0000000..1fedec2 --- /dev/null +++ b/docs/Classes/CoreStoreObjectOrderedDiff.html @@ -0,0 +1,923 @@ + + + + CoreStoreObjectOrderedDiff Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CoreStoreObjectOrderedDiff

+
+
+
public final class CoreStoreObjectOrderedDiff<D> where D : CoreStoreObject
+ +
+
+

The object containing the changeset for an observed RelationshipContainer.Ordered property.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + kind + +
    +
    +
    +
    +
    +
    +

    Indicates the kind of change. See the comments for NSObject.observeValue(forKeyPath:of:change:context:) for more information.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let kind: NSKeyValueChange
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + newValue + +
    +
    +
    +
    +
    +
    +

    newValue and oldValue will only be non-nil if .new/.old is passed to observe(). In general, get the most up to date value by accessing it directly on the observed object instead.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) lazy var newValue: [D] { get set }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + oldValue + +
    +
    +
    +
    +
    +
    +

    newValue and oldValue will only be non-nil if .new/.old is passed to observe(). In general, get the most up to date value by accessing it directly on the observed object instead.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) lazy var oldValue: [D] { get set }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + indexes + +
    +
    +
    +
    +
    +
    +

    indexes will be nil unless the observed KeyPath refers to an ordered to-many property

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let indexes: IndexSet
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + isPrior + +
    +
    +
    +
    +
    +
    +

    ‘isPrior’ will be true if this change observation is being sent before the change happens, due to .prior being passed to observe()

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let isPrior: Bool
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CoreStoreObjectTransformableDiff.html b/docs/Classes/CoreStoreObjectTransformableDiff.html new file mode 100644 index 0000000..7a79fa2 --- /dev/null +++ b/docs/Classes/CoreStoreObjectTransformableDiff.html @@ -0,0 +1,896 @@ + + + + CoreStoreObjectTransformableDiff Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CoreStoreObjectTransformableDiff

+
+
+
public final class CoreStoreObjectTransformableDiff<V> where V : NSCoding, V : NSCopying
+ +
+
+

The object containing the changeset for an observed TransformableContainer.Required or TransformableContainer.Optional property.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + kind + +
    +
    +
    +
    +
    +
    +

    Indicates the kind of change. See the comments for NSObject.observeValue(forKeyPath:of:change:context:) for more information.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let kind: NSKeyValueChange
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + newValue + +
    +
    +
    +
    +
    +
    +

    newValue and oldValue will only be non-nil if .new/.old is passed to observe(). In general, get the most up to date value by accessing it directly on the observed object instead.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let newValue: V?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + oldValue + +
    +
    +
    +
    +
    +
    +

    newValue and oldValue will only be non-nil if .new/.old is passed to observe(). In general, get the most up to date value by accessing it directly on the observed object instead.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let oldValue: V?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + isPrior + +
    +
    +
    +
    +
    +
    +

    ‘isPrior’ will be true if this change observation is being sent before the change happens, due to .prior being passed to observe()

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let isPrior: Bool
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CoreStoreObjectUnorderedDiff.html b/docs/Classes/CoreStoreObjectUnorderedDiff.html new file mode 100644 index 0000000..0f537b9 --- /dev/null +++ b/docs/Classes/CoreStoreObjectUnorderedDiff.html @@ -0,0 +1,896 @@ + + + + CoreStoreObjectUnorderedDiff Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CoreStoreObjectUnorderedDiff

+
+
+
public final class CoreStoreObjectUnorderedDiff<D> where D : CoreStoreObject
+ +
+
+

The object containing the changeset for an observed RelationshipContainer.ToManyUnordered property.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + kind + +
    +
    +
    +
    +
    +
    +

    Indicates the kind of change. See the comments for NSObject.observeValue(forKeyPath:of:change:context:) for more information.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let kind: NSKeyValueChange
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + newValue + +
    +
    +
    +
    +
    +
    +

    newValue and oldValue will only be non-nil if .new/.old is passed to observe(). In general, get the most up to date value by accessing it directly on the observed object instead.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) lazy var newValue: Set<D> { get set }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + oldValue + +
    +
    +
    +
    +
    +
    +

    newValue and oldValue will only be non-nil if .new/.old is passed to observe(). In general, get the most up to date value by accessing it directly on the observed object instead.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) lazy var oldValue: Set<D> { get set }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + isPrior + +
    +
    +
    +
    +
    +
    +

    ‘isPrior’ will be true if this change observation is being sent before the change happens, due to .prior being passed to observe()

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let isPrior: Bool
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CoreStoreObjectValueDiff.html b/docs/Classes/CoreStoreObjectValueDiff.html new file mode 100644 index 0000000..1a0a0b7 --- /dev/null +++ b/docs/Classes/CoreStoreObjectValueDiff.html @@ -0,0 +1,896 @@ + + + + CoreStoreObjectValueDiff Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CoreStoreObjectValueDiff

+
+
+
public final class CoreStoreObjectValueDiff<V> where V : ImportableAttributeType
+ +
+
+

The object containing the changeset for an observed ValueContainer.Required and ValueContainer.Optional property.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + kind + +
    +
    +
    +
    +
    +
    +

    Indicates the kind of change. See the comments for NSObject.observeValue(forKeyPath:of:change:context:) for more information.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let kind: NSKeyValueChange
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + newValue + +
    +
    +
    +
    +
    +
    +

    newValue and oldValue will only be non-nil if .new/.old is passed to observe(). newValue will be nil if isPrior is true.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) lazy var newValue: V? { get set }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + oldValue + +
    +
    +
    +
    +
    +
    +

    newValue and oldValue will only be non-nil if .new/.old is passed to observe().

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) lazy var oldValue: V? { get set }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + isPrior + +
    +
    +
    +
    +
    +
    +

    ‘isPrior’ will be true if this change observation is being sent before the change happens, due to .prior being passed to observe()

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let isPrior: Bool
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CoreStoreSchema.html b/docs/Classes/CoreStoreSchema.html new file mode 100644 index 0000000..a16f7d0 --- /dev/null +++ b/docs/Classes/CoreStoreSchema.html @@ -0,0 +1,1111 @@ + + + + CoreStoreSchema Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CoreStoreSchema

+
+
+
public final class CoreStoreSchema : DynamicSchema
+ +
+
+

The CoreStoreSchema describes models written for CoreStoreObject Swift class declarations for a particular model version. CoreStoreObject entities for a model version should be added to CoreStoreSchema instance.

+
class Animal: CoreStoreObject {
+    let species = Value.Required<String>("species", initial: "")
+    let nickname = Value.Optional<String>("nickname")
+    let master = Relationship.ToOne<Person>("master")
+}
+
+class Person: CoreStoreObject {
+    let name = Value.Required<String>("name", initial: "")
+    let pet = Relationship.ToOne<Animal>("pet", inverse: { $0.master })
+}
+
+CoreStore.defaultStack = DataStack(
+    CoreStoreSchema(
+        modelVersion: "V1",
+        entities: [
+            Entity<Animal>("Animal"),
+            Entity<Person>("Person")
+        ],
+        versionLock: [
+            "Animal": [0x2698c812ebbc3b97, 0x751e3fa3f04cf9, 0x51fd460d3babc82, 0x92b4ba735b5a3053],
+            "Person": [0xae4060a59f990ef0, 0x8ac83a6e1411c130, 0xa29fea58e2e38ab6, 0x2071bb7e33d77887]
+        ]
+    )
+)
+
+
+

See also

+ CoreStoreObject + +
+
+

See also

+ Entity + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes a CoreStoreSchema. Using this initializer only if the entities don’t need to be assigned to particular Configurations. To use multiple configurations (for example, to separate entities in different StorageInterfaces), use the init(modelVersion:entitiesByConfiguration:versionLock:) initializer.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let nickname = Value.Optional<String>("nickname")
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +
    +class Person: CoreStoreObject {
    +    let name = Value.Required<String>("name", initial: "")
    +    let pet = Relationship.ToOne<Animal>("pet", inverse: { $0.master })
    +}
    +
    +CoreStore.defaultStack = DataStack(
    +    CoreStoreSchema(
    +        modelVersion: "V1",
    +        entities: [
    +            Entity<Animal>("Animal"),
    +            Entity<Person>("Person")
    +        ],
    +        versionLock: [
    +            "Animal": [0x2698c812ebbc3b97, 0x751e3fa3f04cf9, 0x51fd460d3babc82, 0x92b4ba735b5a3053],
    +            "Person": [0xae4060a59f990ef0, 0x8ac83a6e1411c130, 0xa29fea58e2e38ab6, 0x2071bb7e33d77887]
    +        ]
    +    )
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(modelVersion: ModelVersion, entities: [DynamicEntity], versionLock: VersionLock? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + modelVersion + + +
    +

    the model version for the schema. This string should be unique from other DynamicSchema‘s model versions.

    +
    +
    + + entities + + +
    +

    an array of Entity<T> pertaining to all CoreStoreObject subclasses to be added to the schema version.

    +
    +
    + + versionLock + + +
    +

    an optional list of VersionLock hashes for each entity name in the entities array. If any DynamicEntity doesn’t match its version lock hash, an assertion will be raised.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a CoreStoreSchema. Using this initializer if multiple Configurations (for example, to separate entities in different StorageInterfaces) are needed. To add an entity only to the default configuration, assign an empty set to its configurations list. Note that regardless of the set configurations, all entities will be added to the default configuration.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let nickname = Value.Optional<String>("nickname")
    +}
    +
    +class Person: CoreStoreObject {
    +    let name = Value.Required<String>("name", initial: "")
    +}
    +
    +CoreStore.defaultStack = DataStack(
    +    CoreStoreSchema(
    +        modelVersion: "V1",
    +        entityConfigurations: [
    +            Entity<Animal>("Animal"): [],
    +            Entity<Person>("Person"): ["People"]
    +        ],
    +        versionLock: [
    +            "Animal": [0x2698c812ebbc3b97, 0x751e3fa3f04cf9, 0x51fd460d3babc82, 0x92b4ba735b5a3053],
    +            "Person": [0xae4060a59f990ef0, 0x8ac83a6e1411c130, 0xa29fea58e2e38ab6, 0x2071bb7e33d77887]
    +        ]
    +    )
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init(modelVersion: ModelVersion, entityConfigurations: [DynamicEntity: Set<String>], versionLock: VersionLock? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + modelVersion + + +
    +

    the model version for the schema. This string should be unique from other DynamicSchema‘s model versions.

    +
    +
    + + entityConfigurations + + +
    +

    a dictionary with Entity<T> pertaining to all CoreStoreObject subclasses and the corresponding list of Configurations they should be added to. To add an entity only to the default configuration, assign an empty set to its configurations list. Note that regardless of the set configurations, all entities will be added to the default configuration.

    +
    +
    + + versionLock + + +
    +

    an optional list of VersionLock hashes for each entity name in the entities array. If any DynamicEntity doesn’t match its version lock hash, an assertion will be raised.

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + modelVersion + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let modelVersion: ModelVersion
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + rawModel() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func rawModel() -> NSManagedObjectModel
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CustomSchemaMappingProvider.html b/docs/Classes/CustomSchemaMappingProvider.html new file mode 100644 index 0000000..d88208b --- /dev/null +++ b/docs/Classes/CustomSchemaMappingProvider.html @@ -0,0 +1,1140 @@ + + + + CustomSchemaMappingProvider Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CustomSchemaMappingProvider

+
+
+
public class CustomSchemaMappingProvider : Hashable, SchemaMappingProvider
+ +
+
+

A SchemaMappingProvider that accepts custom mappings for some entities. Mappings of entities with no CustomMapping provided will be automatically calculated if possible.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + sourceVersion + +
    +
    +
    +
    +
    +
    +

    The source model version for the mapping.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let sourceVersion: ModelVersion
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + destinationVersion + +
    +
    +
    +
    +
    +
    +

    The destination model version for the mapping.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let destinationVersion: ModelVersion
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a CustomSchemaMappingProvider

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init(from sourceVersion: ModelVersion, to destinationVersion: ModelVersion, entityMappings: Set<CustomMapping> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + sourceVersion + + +
    +

    the source model version for the mapping

    +
    +
    + + destinationVersion + + +
    +

    the destination model version for the mapping

    +
    +
    + + entityMappings + + +
    +

    a list of CustomMappings. Mappings of entities with no CustomMapping provided will be automatically calculated if possible. Any conflicts or ambiguity will raise an assertion.

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CustomMapping + +
    +
    +
    +
    +
    +
    +

    Provides the type of mapping for an entity. Mappings of entities with no CustomMapping provided will be automatically calculated if possible. Any conflicts or ambiguity will raise an assertion.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum CustomMapping : Hashable
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + UnsafeSourceObject + +
    +
    +
    +
    +
    +
    +

    The read-only proxy object used for the source object in a mapping’s Transformer closure. Properties can be accessed either by keyPath string or by NSAttributeDescription.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class UnsafeSourceObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    The read-write proxy object used for the destination object that can be created in a mapping’s Transformer closure. Properties can be accessed and mutated either through keyPath string or by NSAttributeDescription.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class UnsafeDestinationObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: CustomSchemaMappingProvider, rhs: CustomSchemaMappingProvider) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CustomSchemaMappingProvider/CustomMapping.html b/docs/Classes/CustomSchemaMappingProvider/CustomMapping.html new file mode 100644 index 0000000..324b775 --- /dev/null +++ b/docs/Classes/CustomSchemaMappingProvider/CustomMapping.html @@ -0,0 +1,1055 @@ + + + + CustomMapping Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CustomMapping

+
+
+
public enum CustomMapping : Hashable
+ +
+
+

Provides the type of mapping for an entity. Mappings of entities with no CustomMapping provided will be automatically calculated if possible. Any conflicts or ambiguity will raise an assertion.

+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    The sourceEntity is meant to be removed from the source DynamicSchema and should not be migrated to the destination DynamicSchema.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case deleteEntity(sourceEntity: EntityName)
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The destinationEntity is newly added to the destination DynamicSchema and has no mapping from the source DynamicSchema.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case insertEntity(destinationEntity: EntityName)
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The DynamicSchemas entity has no changes and can be copied directly from sourceEntity to destinationEntity.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case copyEntity(sourceEntity: EntityName, destinationEntity: EntityName)
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The DynamicSchemas entity needs transformations from sourceEntity to destinationEntity. The transformer closure will be used to apply the changes. The CustomMapping.inferredTransformation method can be used directly as the transformer if the changes can be inferred (i.e. lightweight).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case transformEntity(sourceEntity: EntityName, destinationEntity: EntityName, transformer: Transformer)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + Transformer + +
    +
    +
    +
    +
    +
    +

    The closure type for CustomMapping.transformEntity.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Transformer = (_ sourceObject: UnsafeSourceObject, _ createDestinationObject: () -> UnsafeDestinationObject) throws -> Void
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sourceObject + + +
    +

    a proxy object representing the source entity. The properties can be accessed via keyPath.

    +
    +
    + + createDestinationObject + + +
    +

    the closure to create the object for the destination entity. The CustomMapping.inferredTransformation method can be used directly as the transformer if the changes can be inferred (i.e. lightweight). The object is created lazily and executing the closure multiple times will return the same instance. The destination object’s properties can be accessed and updated via keyPath.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The CustomMapping.inferredTransformation method can be used directly as the transformer if the changes can be inferred (i.e. lightweight).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func inferredTransformation(_ sourceObject: UnsafeSourceObject, _ createDestinationObject: () -> UnsafeDestinationObject) throws
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: CustomMapping, rhs: CustomMapping) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CustomSchemaMappingProvider/UnsafeDestinationObject.html b/docs/Classes/CustomSchemaMappingProvider/UnsafeDestinationObject.html new file mode 100644 index 0000000..2799dbf --- /dev/null +++ b/docs/Classes/CustomSchemaMappingProvider/UnsafeDestinationObject.html @@ -0,0 +1,869 @@ + + + + UnsafeDestinationObject Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

UnsafeDestinationObject

+
+
+
public final class UnsafeDestinationObject
+ +
+
+

The read-write proxy object used for the destination object that can be created in a mapping’s Transformer closure. Properties can be accessed and mutated either through keyPath string or by NSAttributeDescription.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Accesses or mutates the property value via its keyPath.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(attribute: KeyPathString) -> Any? { get set }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Accesses or mutates the property value via its NSAttributeDescription, which can be accessed from the enumerateAttributes(_:) method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(attribute: NSAttributeDescription) -> Any? { get set }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Enumerates the all NSAttributeDescriptions. The attribute argument can be used as the subscript key to access and mutate the property. The sourceAttribute can be used to access properties from the source UnsafeSourceObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func enumerateAttributes(_ closure: (_ attribute: NSAttributeDescription, _ sourceAttribute: NSAttributeDescription?) -> Void)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/CustomSchemaMappingProvider/UnsafeSourceObject.html b/docs/Classes/CustomSchemaMappingProvider/UnsafeSourceObject.html new file mode 100644 index 0000000..3a1c218 --- /dev/null +++ b/docs/Classes/CustomSchemaMappingProvider/UnsafeSourceObject.html @@ -0,0 +1,869 @@ + + + + UnsafeSourceObject Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

UnsafeSourceObject

+
+
+
public final class UnsafeSourceObject
+ +
+
+

The read-only proxy object used for the source object in a mapping’s Transformer closure. Properties can be accessed either by keyPath string or by NSAttributeDescription.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Accesses the property value via its keyPath.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(attribute: KeyPathString) -> Any? { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Accesses the property value via its NSAttributeDescription, which can be accessed from the enumerateAttributes(_:) method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(attribute: NSAttributeDescription) -> Any? { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Enumerates the all NSAttributeDescriptions. The attribute argument can be used as the subscript key to access the property.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func enumerateAttributes(_ closure: (_ attribute: NSAttributeDescription) -> Void)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/DataStack.html b/docs/Classes/DataStack.html new file mode 100644 index 0000000..abccbb9 --- /dev/null +++ b/docs/Classes/DataStack.html @@ -0,0 +1,4996 @@ + + + + DataStack Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

DataStack

+
+
+
public final class DataStack : Equatable
+ +
+
+

The DataStack encapsulates the data model for the Core Data stack. Each DataStack can have multiple data stores, usually specified as a Configuration in the model editor. Behind the scenes, the DataStack manages its own NSPersistentStoreCoordinator, a root NSManagedObjectContext for disk saves, and a shared NSManagedObjectContext designed as a read-only model interface for NSManagedObjects.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + applicationName + +
    +
    +
    +
    +
    +
    +

    The resolved application name, used by the DataStack as the default Xcode model name (.xcdatamodel filename) if not explicitly provided.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let applicationName: String
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Convenience initializer for DataStack that creates a SchemaHistory from the model with the specified modelName in the specified bundle.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(xcodeModelName: XcodeDataModelFileName = DataStack.applicationName, bundle: Bundle = Bundle.main, migrationChain: MigrationChain = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + xcodeModelName + + +
    +

    the name of the (.xcdatamodeld) model file. If not specified, the application name (CFBundleName) will be used if it exists, or CoreData if it the bundle name was not set (e.g. in Unit Tests).

    +
    +
    + + bundle + + +
    +

    an optional bundle to load models from. If not specified, the main bundle will be used.

    +
    +
    + + migrationChain + + +
    +

    the MigrationChain that indicates the sequence of model versions to be used as the order for progressive migrations. If not specified, will default to a non-migrating data stack.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Convenience initializer for DataStack that creates a SchemaHistory from a list of DynamicSchema versions.

    +
    CoreStore.defaultStack = DataStack(
    +    XcodeDataModelSchema(modelName: "MyModelV1"),
    +    CoreStoreSchema(
    +        modelVersion: "MyModelV2",
    +        entities: [
    +            Entity<Animal>("Animal"),
    +            Entity<Person>("Person")
    +        ]
    +    ),
    +    migrationChain: ["MyModelV1", "MyModelV2"]
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(_ schema: DynamicSchema, _ otherSchema: DynamicSchema..., migrationChain: MigrationChain = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + schema + + +
    +

    an instance of DynamicSchema

    +
    +
    + + otherSchema + + +
    +

    a list of other DynamicSchema instances that represent present/previous/future model versions, in any order

    +
    +
    + + migrationChain + + +
    +

    the MigrationChain that indicates the sequence of model versions to be used as the order for progressive migrations. If not specified, will default to a non-migrating data stack.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(schemaHistory:) + +
    +
    +
    +
    +
    +
    +

    Initializes a DataStack from a SchemaHistory instance.

    +
    CoreStore.defaultStack = DataStack(
    +    schemaHistory: SchemaHistory(
    +        XcodeDataModelSchema(modelName: "MyModelV1"),
    +        CoreStoreSchema(
    +            modelVersion: "MyModelV2",
    +            entities: [
    +                Entity<Animal>("Animal"),
    +                Entity<Person>("Person")
    +            ]
    +        ),
    +        migrationChain: ["MyModelV1", "MyModelV2"]
    +    )
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init(schemaHistory: SchemaHistory)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + schemaHistory + + +
    +

    the SchemaHistory for the stack

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + modelVersion + +
    +
    +
    +
    +
    +
    +

    Returns the DataStack‘s current model version. StorageInterfaces added to the stack will be migrated to this version.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var modelVersion: String { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + modelSchema + +
    +
    +
    +
    +
    +
    +

    Returns the DataStack‘s current model schema. StorageInterfaces added to the stack will be migrated to this version.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var modelSchema: DynamicSchema { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the entity name-to-class type mapping from the DataStack‘s model.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func entityTypesByName(for type: NSManagedObject.Type) -> [EntityName : NSManagedObject.Type]
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the entity name-to-class type mapping from the DataStack‘s model.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func entityTypesByName(for type: CoreStoreObject.Type) -> [EntityName : CoreStoreObject.Type]
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the NSEntityDescription for the specified NSManagedObject subclass.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func entityDescription(for type: NSManagedObject.Type) -> NSEntityDescription?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the NSEntityDescription for the specified CoreStoreObject subclass.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func entityDescription(for type: CoreStoreObject.Type) -> NSEntityDescription?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the NSManagedObjectID for the specified object URI if it exists in the persistent store.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func objectID(forURIRepresentation url: URL) -> NSManagedObjectID?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + addStorageAndWait() + +
    +
    +
    +
    +
    +
    +

    Creates an SQLiteStore with default parameters and adds it to the stack. This method blocks until completion.

    +
    try dataStack.addStorageAndWait()
    +
    +
    +

    Throws

    + a CoreStoreError value indicating the failure + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func addStorageAndWait() throws -> SQLiteStore
    + +
    +
    +
    +

    Return Value

    +

    the local SQLite storage added to the stack

    +
    +
    +
    +
  • +
  • +
    + + + + addStorageAndWait(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a StorageInterface to the stack and blocks until completion.

    +
    try dataStack.addStorageAndWait(InMemoryStore(configuration: "Config1"))
    +
    +
    +

    Throws

    + a CoreStoreError value indicating the failure + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func addStorageAndWait<T>(_ storage: T) throws -> T where T : StorageInterface
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + storage + + + +
    +
    +
    +

    Return Value

    +

    the StorageInterface added to the stack

    +
    +
    +
    +
  • +
  • +
    + + + + addStorageAndWait(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a LocalStorage to the stack and blocks until completion.

    +
    try dataStack.addStorageAndWait(SQLiteStore(configuration: "Config1"))
    +
    +
    +

    Throws

    + a CoreStoreError value indicating the failure + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func addStorageAndWait<T>(_ storage: T) throws -> T where T : LocalStorage
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + storage + + +
    +

    the local storage

    +
    +
    +
    +
    +

    Return Value

    +

    the local storage added to the stack. Note that this may not always be the same instance as the parameter argument if a previous LocalStorage was already added at the same URL and with the same configuration.

    +
    +
    +
    +
  • +
  • +
    + + + + addStorageAndWait(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a CloudStorage to the stack and blocks until completion.

    +
    guard let storage = ICloudStore(
    +    ubiquitousContentName: "MyAppCloudData",
    +    ubiquitousContentTransactionLogsSubdirectory: "logs/config1",
    +    ubiquitousContainerID: "iCloud.com.mycompany.myapp.containername",
    +    ubiquitousPeerToken: "9614d658014f4151a95d8048fb717cf0",
    +    configuration: "Config1",
    +    cloudStorageOptions: .recreateLocalStoreOnModelMismatch
    +) else {
    +    // iCloud is not available on the device
    +    return
    +}
    +try dataStack.addStorageAndWait(storage)
    +
    +
    +

    Throws

    + a CoreStoreError value indicating the failure + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func addStorageAndWait<T>(_ storage: T) throws -> T where T : CloudStorage
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + storage + + +
    +

    the local storage

    +
    +
    +
    +
    +

    Return Value

    +

    the cloud storage added to the stack. Note that this may not always be the same instance as the parameter argument if a previous CloudStorage was already added at the same URL and with the same configuration.

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + userInfo + +
    +
    +
    +
    +
    +
    +

    Allow external libraries to store custom data in the DataStack. App code should rarely have a need for this.

    +
    enum Static {
    +   static var myDataKey: Void?
    +}
    +CoreStore.defaultStack.userInfo[&Static.myDataKey] = myObject
    +
    +
    +

    Important

    + Do not use this method to store thread-sensitive data. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let userInfo: UserInfo
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: DataStack, rhs: DataStack) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Asynchronously adds a StorageInterface to the stack. Migrations are also initiated by default.

    +
    dataStack.addStorage(
    +    InMemoryStore(configuration: "Config1"),
    +    completion: { result in
    +        switch result {
    +        case .success(let storage): // ...
    +        case .failure(let error): // ...
    +        }
    +    }
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func addStorage<T>(_ storage: T, completion: @escaping (SetupResult<T>) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the storage

    +
    +
    + + completion + + +
    +

    the closure to be executed on the main queue when the process completes, either due to success or failure. The closure’s SetupResult argument indicates the result. Note that the StorageInterface associated to the SetupResult.success may not always be the same instance as the parameter argument if a previous StorageInterface was already added at the same URL and with the same configuration.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously adds a LocalStorage to the stack. Migrations are also initiated by default.

    +
    let migrationProgress = dataStack.addStorage(
    +    SQLiteStore(fileName: "core_data.sqlite", configuration: "Config1"),
    +    completion: { result in
    +        switch result {
    +        case .success(let storage): // ...
    +        case .failure(let error): // ...
    +        }
    +    }
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func addStorage<T: LocalStorage>(_ storage: T, completion: @escaping (SetupResult<T>) -> Void) -> Progress?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the local storage

    +
    +
    + + completion + + +
    +

    the closure to be executed on the main queue when the process completes, either due to success or failure. The closure’s SetupResult argument indicates the result. Note that the LocalStorage associated to the SetupResult.success may not always be the same instance as the parameter argument if a previous LocalStorage was already added at the same URL and with the same configuration.

    +
    +
    +
    +
    +

    Return Value

    +

    a Progress instance if a migration has started, or nil if either no migrations are required or if a failure occured.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously adds a CloudStorage to the stack. Migrations are also initiated by default.

    +
    guard let storage = ICloudStore(
    +    ubiquitousContentName: "MyAppCloudData",
    +    ubiquitousContentTransactionLogsSubdirectory: "logs/config1",
    +    ubiquitousContainerID: "iCloud.com.mycompany.myapp.containername",
    +    ubiquitousPeerToken: "9614d658014f4151a95d8048fb717cf0",
    +    configuration: "Config1",
    +    cloudStorageOptions: .recreateLocalStoreOnModelMismatch
    +) else {
    +    // iCloud is not available on the device
    +    return
    +}
    +dataStack.addStorage(
    +    storage,
    +    completion: { result in
    +        switch result {
    +        case .success(let storage): // ...
    +        case .failure(let error): // ...
    +        }
    +    }
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func addStorage<T: CloudStorage>(_ storage: T, completion: @escaping (SetupResult<T>) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the cloud storage

    +
    +
    + + completion + + +
    +

    the closure to be executed on the main queue when the process completes, either due to success or failure. The closure’s SetupResult argument indicates the result. Note that the CloudStorage associated to the SetupResult.success may not always be the same instance as the parameter argument if a previous CloudStorage was already added at the same URL and with the same configuration.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Migrates a local storage to match the DataStack‘s managed object model version. This method does NOT add the migrated store to the data stack.

    +
    +

    Throws

    + a CoreStoreError value indicating the failure + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func upgradeStorageIfNeeded<T: LocalStorage>(_ storage: T, completion: @escaping (MigrationResult) -> Void) throws -> Progress?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the local storage

    +
    +
    + + completion + + +
    +

    the closure to be executed on the main queue when the migration completes, either due to success or failure. The closure’s MigrationResult argument indicates the result.

    +
    +
    +
    +
    +

    Return Value

    +

    a Progress instance if a migration has started, or nil is no migrations are required

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Checks the migration steps required for the storage to match the DataStack‘s managed object model version.

    +
    +

    Throws

    + a CoreStoreError value indicating the failure + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func requiredMigrationsForStorage<T>(_ storage: T) throws -> [MigrationType] where T : LocalStorage
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + storage + + +
    +

    the local storage

    +
    +
    +
    +
    +

    Return Value

    +

    a MigrationType array indicating the migration steps required for the store, or an empty array if the file does not exist yet. Otherwise, an error is thrown if either inspection of the store failed, or if no mapping model was found/inferred.

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + monitorObject(_:) + +
    +
    +
    +
    +
    +
    +

    Creates an ObjectMonitor for the specified DynamicObject. Multiple ObjectObservers may then register themselves to be notified when changes are made to the DynamicObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorObject<D>(_ object: D) -> ObjectMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the DynamicObject to observe changes from

    +
    +
    +
    +
    +

    Return Value

    +

    a ObjectMonitor that monitors changes to object

    +
    +
    +
    +
  • +
  • +
    + + + + monitorList(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ListMonitor for a list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorList<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> ListMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • +
    + + + + monitorList(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ListMonitor for a list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorList<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> ListMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • +
    + + + + monitorList(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ListMonitor for a list of DynamicObjects that satisfy the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let monitor = dataStack.monitorList(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorList<B>(_ clauseChain: B) -> ListMonitor<B.ObjectType> where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor for a list of DynamicObjects that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a ListMonitor for a list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorList<D>(createAsynchronously: @escaping (ListMonitor<D>) -> Void, _ from: From<D>, _ fetchClauses: FetchClause...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a ListMonitor for a list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorList<D>(createAsynchronously: @escaping (ListMonitor<D>) -> Void, _ from: From<D>, _ fetchClauses: [FetchClause])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a ListMonitor for a list of DynamicObjects that satisfy the specified FetchChainableBuilderType built from a chain of clauses. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    +
    dataStack.monitorList(
    +    { (monitor) in
    +        self.monitor = monitor
    +    },
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorList<B: FetchChainableBuilderType>(createAsynchronously: @escaping (ListMonitor<B.ObjectType>) -> Void, _ clauseChain: B)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor for a list of DynamicObjects that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorSectionedList<D>(_ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: FetchClause...) -> ListMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorSectionedList<D>(_ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: [FetchClause]) -> ListMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified SectionMonitorBuilderType built from a chain of clauses.

    +
    let monitor = dataStack.monitorSectionedList(
    +    From<MyPersonEntity>()
    +        .sectionBy(\.age, { "\($0!) years old" })
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorSectionedList<B>(_ clauseChain: B) -> ListMonitor<B.ObjectType> where B : SectionMonitorBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a SectionMonitorBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor for a list of DynamicObjects that satisfy the specified SectionMonitorBuilderType

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorSectionedList<D>(createAsynchronously: @escaping (ListMonitor<D>) -> Void, _ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: FetchClause...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorSectionedList<D>(createAsynchronously: @escaping (ListMonitor<D>) -> Void, _ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: [FetchClause])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified SectionMonitorBuilderType built from a chain of clauses.

    +
    dataStack.monitorSectionedList(
    +    { (monitor) in
    +        self.monitor = monitor
    +    },
    +    From<MyPersonEntity>()
    +        .sectionBy(\.age, { "\($0!) years old" })
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorSectionedList<B: SectionMonitorBuilderType>(createAsynchronously: @escaping (ListMonitor<B.ObjectType>) -> Void, _ clauseChain: B)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a SectionMonitorBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor for a list of DynamicObjects that satisfy the specified SectionMonitorBuilderType

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the DynamicObject instance in the DataStack‘s context from a reference created from a transaction or from a different managed object context.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchExisting<D>(_ object: D) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    a reference to the object created/fetched outside the DataStack

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject instance if the object exists in the DataStack, or nil if not found.

    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the DynamicObject instance in the DataStack‘s context from an NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchExisting<D>(_ objectID: NSManagedObjectID) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objectID + + +
    +

    the NSManagedObjectID for the object

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject instance if the object exists in the DataStack, or nil if not found.

    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the DynamicObject instances in the DataStack‘s context from references created from a transaction or from a different managed object context.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchExisting<D, S>(_ objects: S) -> [D] where D : DynamicObject, D == S.Element, S : Sequence
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objects + + +
    +

    an array of DynamicObjects created/fetched outside the DataStack

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject array for objects that exists in the DataStack

    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the DynamicObject instances in the DataStack‘s context from a list of NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchExisting<D, S>(_ objectIDs: S) -> [D] where D : DynamicObject, S : Sequence, S.Element == NSManagedObjectID
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objectIDs + + +
    +

    the NSManagedObjectID array for the objects

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject array for objects that exists in the DataStack

    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the first DynamicObject instance that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchOne<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the first DynamicObject instance that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the first DynamicObject instance that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchOne<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the first DynamicObject instance that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the first DynamicObject instance that satisfies the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let youngestTeen = dataStack.fetchOne(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchOne<B>(_ clauseChain: B) -> B.ObjectType? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the first DynamicObject instance that satisfies the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches all DynamicObject instances that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchAll<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> [D]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    all DynamicObject instances that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches all DynamicObject instances that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchAll<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> [D]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    all DynamicObject instances that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches all DynamicObject instances that satisfy the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let people = dataStack.fetchAll(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchAll<B>(_ clauseChain: B) -> [B.ObjectType]? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    all DynamicObject instances that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the number of DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchCount<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> Int? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the number DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the number of DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchCount<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> Int? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the number DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the number of DynamicObjects that satisfy the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let numberOfAdults = dataStack.fetchCount(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchCount<B>(_ clauseChain: B) -> Int? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the number DynamicObjects that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> NSManagedObjectID? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> NSManagedObjectID? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let youngestTeenID = dataStack.fetchObjectID(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchObjectID<B>(_ clauseChain: B) -> NSManagedObjectID? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> [NSManagedObjectID]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> [NSManagedObjectID]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let idsOfAdults = dataStack.fetchObjectIDs(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchObjectIDs<B>(_ clauseChain: B) -> [NSManagedObjectID]? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + queryValue(_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Queries aggregate values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queryValue<D, U>(_ from: From<D>, _ selectClause: Select<D, U>, _ queryClauses: QueryClause...) -> U? where D : DynamicObject, U : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • +
    + + + + queryValue(_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Queries aggregate values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queryValue<D, U>(_ from: From<D>, _ selectClause: Select<D, U>, _ queryClauses: [QueryClause]) -> U? where D : DynamicObject, U : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • +
    + + + + queryValue(_:) + +
    +
    +
    +
    +
    +
    +

    Queries a property value or aggregate as specified by the QueryChainableBuilderType built from a chain of clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    +
    let averageAdultAge = dataStack.queryValue(
    +    From<MyPersonEntity>()
    +        .select(Int.self, .average(\.age))
    +        .where(\.age > 18)
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queryValue<B>(_ clauseChain: B) -> B.ResultType? where B : QueryChainableBuilderType, B.ResultType : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a QueryChainableBuilderType indicating the property/aggregate to fetch and the series of queries for the request.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query as specified by the QueryChainableBuilderType

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Queries a dictionary of attribute values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queryAttributes<D>(_ from: From<D>, _ selectClause: Select<D, NSDictionary>, _ queryClauses: QueryClause...) -> [[String : Any]]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Queries a dictionary of attribute values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queryAttributes<D>(_ from: From<D>, _ selectClause: Select<D, NSDictionary>, _ queryClauses: [QueryClause]) -> [[String : Any]]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • +
    + + + + queryAttributes(_:) + +
    +
    +
    +
    +
    +
    +

    Queries a dictionary of attribute values or as specified by the QueryChainableBuilderType built from a chain of clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    +
    let results = dataStack.queryAttributes(
    +    From<MyPersonEntity>()
    +        .select(
    +            NSDictionary.self,
    +            .attribute(\.age, as: "age"),
    +            .count(\.age, as: "numberOfPeople")
    +        )
    +        .groupBy(\.age)
    +)
    +for dictionary in results! {
    +    let age = dictionary["age"] as! Int
    +    let count = dictionary["numberOfPeople"] as! Int
    +    print("There are \(count) people who are \(age) years old."
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queryAttributes<B>(_ clauseChain: B) -> [[String : Any]]? where B : QueryChainableBuilderType, B.ResultType == NSDictionary
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a QueryChainableBuilderType indicating the properties to fetch and the series of queries for the request.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query as specified by the QueryChainableBuilderType

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + unsafeContext() + +
    +
    +
    +
    +
    +
    +

    The internal NSManagedObjectContext managed by this instance. Using this context directly should typically be avoided, and is provided by CoreStore only for extremely specialized cases.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func unsafeContext() -> NSManagedObjectContext
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Performs a transaction asynchronously where NSManagedObject or CoreStoreObject creates, updates, and deletes can be made. The changes are commited automatically after the task closure returns. On success, the value returned from closure will be the wrapped as .success(userInfo: T) in the completion‘s Result<T>. Any errors thrown from inside the task will be reported as .failure(error: CoreStoreError). To cancel/rollback changes, call try transaction.cancel(), which throws a CoreStoreError.userCancelled.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func perform<T>(asynchronous task: @escaping (_ transaction: AsynchronousDataTransaction) throws -> T, completion: @escaping (AsynchronousDataTransaction.Result<T>) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + task + + +
    +

    the asynchronous closure where creates, updates, and deletes can be made to the transaction. Transaction blocks are executed serially in a background queue, and all changes are made from a concurrent NSManagedObjectContext.

    +
    +
    + + completion + + +
    +

    the closure executed after the save completes. The Result argument of the closure will either wrap the return value of task, or any uncaught errors thrown from within task. Cancelled tasks will be indicated by .failure(error: CoreStoreError.userCancelled). Custom errors thrown by the user will be wrapped in CoreStoreError.userError(error: Error).

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Performs a transaction asynchronously where NSManagedObject or CoreStoreObject creates, updates, and deletes can be made. The changes are commited automatically after the task closure returns. On success, the value returned from closure will be the argument of the success closure. Any errors thrown from inside the task will be wrapped in a CoreStoreError and reported in the failure closure. To cancel/rollback changes, call try transaction.cancel(), which throws a CoreStoreError.userCancelled.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func perform<T>(asynchronous task: @escaping (_ transaction: AsynchronousDataTransaction) throws -> T, success: @escaping (T) -> Void, failure: @escaping (CoreStoreError) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + task + + +
    +

    the asynchronous closure where creates, updates, and deletes can be made to the transaction. Transaction blocks are executed serially in a background queue, and all changes are made from a concurrent NSManagedObjectContext.

    +
    +
    + + success + + +
    +

    the closure executed after the save succeeds. The T argument of the closure will be the value returned from task.

    +
    +
    + + failure + + +
    +

    the closure executed if the save fails or if any errors are thrown within task. Cancelled tasks will be indicated by CoreStoreError.userCancelled. Custom errors thrown by the user will be wrapped in CoreStoreError.userError(error: Error).

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Performs a transaction synchronously where NSManagedObject or CoreStoreObject creates, updates, and deletes can be made. The changes are commited automatically after the task closure returns. On success, the value returned from closure will be the return value of perform(synchronous:). Any errors thrown from inside the task will be thrown from perform(synchronous:). To cancel/rollback changes, call try transaction.cancel(), which throws a CoreStoreError.userCancelled.

    +
    +

    Throws

    + a CoreStoreError value indicating the failure. Cancelled tasks will be indicated by CoreStoreError.userCancelled. Custom errors thrown by the user will be wrapped in CoreStoreError.userError(error: Error). + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func perform<T>(synchronous task: ((_ transaction: SynchronousDataTransaction) throws -> T), waitForAllObservers: Bool = true) throws -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + task + + +
    +

    the synchronous non-escaping closure where creates, updates, and deletes can be made to the transaction. Transaction blocks are executed serially in a background queue, and all changes are made from a concurrent NSManagedObjectContext.

    +
    +
    + + waitForAllObservers + + +
    +

    When true, this method waits for all observers to be notified of the changes before returning. This results in more predictable data update order, but may risk triggering deadlocks. When false, this method does not wait for observers to be notified of the changes before returning. This results in lower risk for deadlocks, but the updated data may not have been propagated to the DataStack after returning. Defaults to true.

    +
    +
    +
    +
    +

    Return Value

    +

    the value returned from task

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Begins a non-contiguous transaction where NSManagedObject or CoreStoreObject creates, updates, and deletes can be made. This is useful for making temporary changes, such as partially filled forms.

    + +
      +
    • prameter supportsUndo: undo(), redo(), and rollback() methods are only available when this parameter is true, otherwise those method will raise an exception. Defaults to false. Note that turning on Undo support may heavily impact performance especially on iOS or watchOS where memory is limited.
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func beginUnsafe(supportsUndo: Bool = false) -> UnsafeDataTransaction
    + +
    +
    +
    +

    Return Value

    +

    a UnsafeDataTransaction instance where creates, updates, and deletes can be made.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Refreshes all registered objects NSManagedObjects or CoreStoreObjects in the DataStack.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func refreshAndMergeAllObjects()
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Utility for creating an NSFetchedResultsController from the DataStack. This is useful when an NSFetchedResultsController is preferred over the overhead of ListMonitors abstraction.

    +
    +

    Note

    +

    It is the caller’s responsibility to call performFetch() on the created NSFetchedResultsController.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func createFetchedResultsController<D>(_ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: FetchClause...) -> NSFetchedResultsController<D> where D : NSManagedObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    an NSFetchedResultsController that observes the DataStack

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Utility for creating an NSFetchedResultsController from a DataStack. This is useful when an NSFetchedResultsController is preferred over the overhead of ListMonitors abstraction.

    +
    +

    Note

    +

    It is the caller’s responsibility to call performFetch() on the created NSFetchedResultsController.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func createFetchedResultsController<D>(_ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: [FetchClause]) -> NSFetchedResultsController<D> where D : NSManagedObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    an NSFetchedResultsController that observes the DataStack

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Utility for creating an NSFetchedResultsController from the DataStack. This is useful when an NSFetchedResultsController is preferred over the overhead of ListMonitors abstraction.

    +
    +

    Note

    +

    It is the caller’s responsibility to call performFetch() on the created NSFetchedResultsController.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func createFetchedResultsController<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> NSFetchedResultsController<D> where D : NSManagedObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    an NSFetchedResultsController that observes the DataStack

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Utility for creating an NSFetchedResultsController from the DataStack. This is useful when an NSFetchedResultsController is preferred over the overhead of ListMonitors abstraction.

    +
    +

    Note

    +

    It is the caller’s responsibility to call performFetch() on the created NSFetchedResultsController.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func createFetchedResultsController<D>(forDataStack dataStack: DataStack, _ from: From<D>, _ fetchClauses: [FetchClause]) -> NSFetchedResultsController<D> where D : NSManagedObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    an NSFetchedResultsController that observes the DataStack

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/DefaultLogger.html b/docs/Classes/DefaultLogger.html new file mode 100644 index 0000000..ba709c2 --- /dev/null +++ b/docs/Classes/DefaultLogger.html @@ -0,0 +1,1172 @@ + + + + DefaultLogger Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

DefaultLogger

+
+
+
public final class DefaultLogger : CoreStoreLogger
+ +
+
+

The DefaultLogger is a basic implementation of the CoreStoreLogger protocol.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Creates a DefaultLogger.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Handles log messages sent by the CoreStore framework.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func log(level: LogLevel, message: String, fileName: StaticString, lineNumber: Int, functionName: StaticString)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + +
    + + level + + +
    +

    the severity of the log message

    +
    +
    + + message + + +
    +

    the log message

    +
    +
    + + fileName + + +
    +

    the source file name

    +
    +
    + + lineNumber + + +
    +

    the source line number

    +
    +
    + + functionName + + +
    +

    the source function name

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Handles errors sent by the CoreStore framework.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func log(error: CoreStoreError, message: String, fileName: StaticString, lineNumber: Int, functionName: StaticString)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + +
    + + error + + +
    +

    the error

    +
    +
    + + message + + +
    +

    the error message

    +
    +
    + + fileName + + +
    +

    the source file name

    +
    +
    + + lineNumber + + +
    +

    the source line number

    +
    +
    + + functionName + + +
    +

    the source function name

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Handles assertions made throughout the CoreStore framework.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func assert(_ condition: @autoclosure () -> Bool, message: @autoclosure () -> String, fileName: StaticString, lineNumber: Int, functionName: StaticString)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + message + + +
    +

    the assertion message

    +
    +
    + + fileName + + +
    +

    the source file name

    +
    +
    + + lineNumber + + +
    +

    the source line number

    +
    +
    + + functionName + + +
    +

    the source function name

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Handles fatal errors made throughout the CoreStore framework.

    +
    +

    Important

    +

    Implementers should guarantee that this function doesn’t return, either by calling another Never function such as fatalError() or abort(), or by raising an exception.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func abort(_ message: String, fileName: StaticString, lineNumber: Int, functionName: StaticString)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + message + + +
    +

    the fatal error message

    +
    +
    + + fileName + + +
    +

    the source file name

    +
    +
    + + lineNumber + + +
    +

    the source line number

    +
    +
    + + functionName + + +
    +

    the source function name

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/DynamicEntity.html b/docs/Classes/DynamicEntity.html new file mode 100644 index 0000000..2f65abc --- /dev/null +++ b/docs/Classes/DynamicEntity.html @@ -0,0 +1,1024 @@ + + + + DynamicEntity Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

DynamicEntity

+
+
+
public class DynamicEntity : Hashable
+ +
+
+

Use concrete instances of Entity<O> in API that accept DynamicEntity arguments.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + type + +
    +
    +
    +
    +
    +
    +

    Do not use directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let type: DynamicObject.Type
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + entityName + +
    +
    +
    +
    +
    +
    +

    Do not use directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let entityName: EntityName
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + isAbstract + +
    +
    +
    +
    +
    +
    +

    Do not use directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let isAbstract: Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + versionHashModifier + +
    +
    +
    +
    +
    +
    +

    Do not use directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let versionHashModifier: String?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + indexes + +
    +
    +
    +
    +
    +
    +

    Do not use directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let indexes: [[KeyPathString]]
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + uniqueConstraints + +
    +
    +
    +
    +
    +
    +

    Do not use directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let uniqueConstraints: [[KeyPathString]]
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: DynamicEntity, rhs: DynamicEntity) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/Entity.html b/docs/Classes/Entity.html new file mode 100644 index 0000000..f1a4388 --- /dev/null +++ b/docs/Classes/Entity.html @@ -0,0 +1,1060 @@ + + + + Entity Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Entity

+
+
+
public final class Entity<O> : DynamicEntity where O : CoreStoreObject
+ +
+
+

The Entity<O> contains NSEntityDescription metadata for CoreStoreObject subclasses. Pass the Entity instances to CoreStoreSchema initializer.

+
class Animal: CoreStoreObject {
+    let species = Value.Required<String>("species", initial: "")
+    let nickname = Value.Optional<String>("nickname")
+    let master = Relationship.ToOne<Person>("master")
+}
+
+class Person: CoreStoreObject {
+    let name = Value.Required<String>("name", initial: "")
+    let pet = Relationship.ToOne<Animal>("pet", inverse: { $0.master })
+}
+
+CoreStore.defaultStack = DataStack(
+    CoreStoreSchema(
+        modelVersion: "V1",
+        entities: [
+            Entity<Animal>("Animal"),
+            Entity<Person>("Person")
+        ]
+    )
+)
+
+
+

See also

+ CoreStoreSchema + +
+
+

See also

+ CoreStoreObject + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes an Entity. Always provide a concrete generic type to Entity.

    +
    Entity<Animal>("Animal")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(_ entityName: String, isAbstract: Bool = false, versionHashModifier: String? = nil, indexes: [[PartialKeyPath<O>]] = [], uniqueConstraints: [[PartialKeyPath<O>]] = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + +
    + + entityName + + +
    +

    the NSEntityDescription name to use for the entity

    +
    +
    + + isAbstract + + +
    +

    set to true if the entity is meant to be an abstract class and can only be initialized with subclass types.

    +
    +
    + + versionHashModifier + + +
    +

    the version hash modifier for the entity. Used to mark or denote an entity as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where, for example, the structure of an entity is unchanged but the format or content of data has changed.)

    +
    +
    + + indexes + + +
    +

    the compound indexes for the entity as an array of arrays. The arrays contained in the returned array contain KeyPaths to properties of the entity.

    +
    +
    + + uniqueConstraints + + +
    +

    sets uniqueness constraints for the entity. A uniqueness constraint is a set of one or more KeyPaths whose value must be unique over the set of instances of that entity. This value forms part of the entity’s version hash. Uniqueness constraint violations can be computationally expensive to handle. It is highly suggested that there be only one uniqueness constraint per entity hierarchy. Uniqueness constraints must be defined at the highest level possible, and CoreStore will raise an assertion failure if unique constraints are added to a sub entity.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes an Entity.

    +
    Entity(Animal.self, "Animal")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ type: O.Type, _ entityName: String, isAbstract: Bool = false, versionHashModifier: String? = nil, indexes: [[PartialKeyPath<O>]] = [], uniqueConstraints: [[PartialKeyPath<O>]] = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + type + + +
    +

    the DynamicObject type associated with the entity

    +
    +
    + + entityName + + +
    +

    the NSEntityDescription name to use for the entity

    +
    +
    + + isAbstract + + +
    +

    set to true if the entity is meant to be an abstract class and can only be initialized with subclass types.

    +
    +
    + + versionHashModifier + + +
    +

    the version hash modifier for the entity. Used to mark or denote an entity as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where, for example, the structure of an entity is unchanged but the format or content of data has changed.)

    +
    +
    + + indexes + + +
    +

    the compound indexes for the entity as an array of arrays. The arrays contained in the returned array contain KeyPath’s to properties of the entity.

    +
    +
    + + uniqueConstraints + + +
    +

    sets uniqueness constraints for the entity. A uniqueness constraint is a set of one or more KeyPaths whose value must be unique over the set of instances of that entity. This value forms part of the entity’s version hash. Uniqueness constraint violations can be computationally expensive to handle. It is highly suggested that there be only one uniqueness constraint per entity hierarchy. Uniqueness constraints must be defined at the highest level possible, and CoreStore will raise an assertion failure if unique constraints are added to a sub entity.

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/ICloudStore.html b/docs/Classes/ICloudStore.html new file mode 100644 index 0000000..7a209a8 --- /dev/null +++ b/docs/Classes/ICloudStore.html @@ -0,0 +1,1309 @@ + + + + ICloudStore Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ICloudStore

+
+
+
@available(*, deprecated, message: "Please see the release notes and Core Data documentation.")
+public final class ICloudStore : CloudStorage
+ +
+
+

A storage interface backed by an SQLite database managed by iCloud.

+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes an iCloud store interface from the given ubiquitous store information. Returns nil if the container could not be located or if iCloud storage is unavailable for the current user or device

    +
    guard let storage = ICloudStore(
    +    ubiquitousContentName: "MyAppCloudData",
    +    ubiquitousContentTransactionLogsSubdirectory: "logs/config1",
    +    ubiquitousContainerID: "iCloud.com.mycompany.myapp.containername",
    +    ubiquitousPeerToken: "9614d658014f4151a95d8048fb717cf0",
    +    configuration: "Config1",
    +    cloudStorageOptions: .recreateLocalStoreOnModelMismatch
    +) else {
    +    // iCloud is not available on the device
    +    return
    +}
    +CoreStore.addStorage(
    +    storage,
    +    completion: { result in
    +        // ...
    +    }
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init?(ubiquitousContentName: String, ubiquitousContentTransactionLogsSubdirectory: String, ubiquitousContainerID: String? = nil, ubiquitousPeerToken: String? = nil, configuration: ModelConfiguration = nil, cloudStorageOptions: CloudStorageOptions = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + ubiquitousContentName + + +
    +

    the name of the store in iCloud. This is required and should not be empty, and should not contain periods (.).

    +
    +
    + + ubiquitousContentTransactionLogsSubdirectory + + +
    +

    a required relative path for the transaction logs

    +
    +
    + + ubiquitousContainerID + + +
    +

    a container if your app has multiple ubiquity container identifiers in its entitlements

    +
    +
    + + ubiquitousPeerToken + + +
    +

    a per-application salt to allow multiple apps on the same device to share a Core Data store integrated with iCloud

    +
    +
    + + configuration + + +
    +

    an optional configuration name from the model file. If not specified, defaults to nil, the Default configuration. Note that if you have multiple configurations, you will need to specify a different ubiquitousContentName explicitly for each of them.

    +
    +
    + + cloudStorageOptions + + +
    +

    When the ICloudStore is passed to the DataStack‘s addStorage() methods, tells the DataStack how to setup the persistent store. Defaults to .None.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + addObserver(_:) + +
    +
    +
    +
    +
    +
    +

    Registers an ICloudStoreObserver to start receive notifications from the ubiquitous store

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func addObserver<T>(_ observer: T) where T : ICloudStoreObserver
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + observer + + +
    +

    the observer to start sending ubiquitous notifications to

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + removeObserver(_:) + +
    +
    +
    +
    +
    +
    +

    Unregisters an ICloudStoreObserver to stop receiving notifications from the ubiquitous store

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func removeObserver(_ observer: ICloudStoreObserver)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + observer + + +
    +

    the observer to stop sending ubiquitous notifications to

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + storeType + +
    +
    +
    +
    +
    +
    +

    The string identifier for the NSPersistentStore‘s type property. For SQLiteStores, this is always set to NSSQLiteStoreType.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let storeType: String
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    +

    The configuration name in the model file

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let configuration: ModelConfiguration
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + storeOptions + +
    +
    +
    +
    +
    +
    +

    The options dictionary for the NSPersistentStore. For SQLiteStores, this is always set to

    +
    [NSSQLitePragmasOption: ["journal_mode": "WAL"]]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let storeOptions: [AnyHashable : Any]?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Do not call directly. Used by the DataStack internally.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cs_didAddToDataStack(_ dataStack: DataStack)
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Do not call directly. Used by the DataStack internally.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cs_didRemoveFromDataStack(_ dataStack: DataStack)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + cacheFileURL + +
    +
    +
    +
    +
    +
    +

    The NSURL that points to the ubiquity container file

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let cacheFileURL: URL
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cloudStorageOptions + +
    +
    +
    +
    +
    +
    +

    Options that tell the DataStack how to setup the persistent store

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var cloudStorageOptions: CloudStorageOptions
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The options dictionary for the specified CloudStorageOptions

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func dictionary(forOptions options: CloudStorageOptions) -> [AnyHashable : Any]?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Called by the DataStack to perform actual deletion of the store file from disk. Do not call directly! The sourceModel argument is a hint for the existing store’s model version. For SQLiteStore, this converts the database’s WAL journaling mode to DELETE before deleting the file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cs_eraseStorageAndWait(soureModel: NSManagedObjectModel) throws
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/InMemoryStore.html b/docs/Classes/InMemoryStore.html new file mode 100644 index 0000000..71de0f1 --- /dev/null +++ b/docs/Classes/InMemoryStore.html @@ -0,0 +1,1081 @@ + + + + InMemoryStore Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

InMemoryStore

+
+
+
public final class InMemoryStore : StorageInterface
+ +
+
+

A storage interface that is backed only in memory.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + init(configuration:) + +
    +
    +
    +
    +
    +
    +

    Initializes an InMemoryStore for the specified configuration

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(configuration: ModelConfiguration)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + configuration + + +
    +

    an optional configuration name from the model file. If not specified, defaults to nil, the Default configuration.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes an InMemoryStore with the Default configuration

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + storeType + +
    +
    +
    +
    +
    +
    +

    The string identifier for the NSPersistentStore‘s type property. For InMemoryStores, this is always set to NSInMemoryStoreType.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let storeType: String
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    +

    The configuration name in the model file

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let configuration: ModelConfiguration
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + storeOptions + +
    +
    +
    +
    +
    +
    +

    The options dictionary for the NSPersistentStore. For InMemoryStores, this is always set to nil.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let storeOptions: [AnyHashable : Any]?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Do not call directly. Used by the DataStack internally.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cs_didAddToDataStack(_ dataStack: DataStack)
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Do not call directly. Used by the DataStack internally.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cs_didRemoveFromDataStack(_ dataStack: DataStack)
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/InferredSchemaMappingProvider.html b/docs/Classes/InferredSchemaMappingProvider.html new file mode 100644 index 0000000..5c88de3 --- /dev/null +++ b/docs/Classes/InferredSchemaMappingProvider.html @@ -0,0 +1,895 @@ + + + + InferredSchemaMappingProvider Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

InferredSchemaMappingProvider

+
+
+
public final class InferredSchemaMappingProvider : Hashable, SchemaMappingProvider
+ +
+
+

A SchemaMappingProvider that tries to infer model migration between two DynamicSchema versions by searching all xcmappingmodels from Bundle.allBundles or by relying on lightweight migration if possible. Throws an error if lightweight migration is impossible for the two DynamicSchema. This mapping is automatically used as a fallback mapping provider, even if no mapping providers are explicitly declared in the StorageInterface.

+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: InferredSchemaMappingProvider, rhs: InferredSchemaMappingProvider) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+
+ +
+
+ + + + diff --git a/docs/Classes/ListMonitor.html b/docs/Classes/ListMonitor.html new file mode 100644 index 0000000..059aca3 --- /dev/null +++ b/docs/Classes/ListMonitor.html @@ -0,0 +1,2571 @@ + + + + ListMonitor Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ListMonitor

+
+
+
@available(OSX 10.12, *)
+public final class ListMonitor<D> : Hashable where D : DynamicObject
+ +
+
+

The ListMonitor monitors changes to a list of DynamicObject instances. Observers that implement the ListObserver protocol may then register themselves to the ListMonitor‘s addObserver(_:) method:

+
let monitor = CoreStore.monitorList(
+    From<Person>(),
+    Where("title", isEqualTo: "Engineer"),
+    OrderBy(.ascending("lastName"))
+)
+monitor.addObserver(self)
+
+ +

The ListMonitor instance needs to be held on (retained) for as long as the list needs to be observed. +Observers registered via addObserver(_:) are not retained. ListMonitor only keeps a weak reference to all observers, thus keeping itself free from retain-cycles.

+ +

Lists created with monitorList(...) keep a single-section list of objects, where each object can be accessed by index:

+
let firstPerson: MyPersonEntity = monitor[0]
+
+ +

Accessing the list with an index above the valid range will raise an exception.

+ +

Creating a sectioned-list is also possible with the monitorSectionedList(...) method:

+
let monitor = CoreStore.monitorSectionedList(
+    From<Person>(),
+    SectionBy("age") { "Age \($0)" },
+    Where("title", isEqualTo: "Engineer"),
+    OrderBy(.ascending("lastName"))
+)
+monitor.addObserver(self)
+
+ +

Objects from ListMonitors created this way can be accessed either by an IndexPath or a tuple:

+
let indexPath = IndexPath(forItem: 3, inSection: 2)
+let person1 = monitor[indexPath]
+let person2 = monitor[2, 3]
+
+ +

In the example above, both person1 and person2 will contain the object at section=2, index=3.

+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    +

    The type for the objects contained bye the ListMonitor

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = D
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the object at the given index within the first section. This subscript indexer is typically used for ListMonitors created with monitorList(_:).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(index: Int) -> ObjectType { get }
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + index + + +
    +

    the index of the object. Using an index above the valid range will raise an exception.

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject at the specified index

    +
    +
    +
    +
  • +
  • +
    + + + + subscript(safeIndex:) + +
    +
    +
    +
    +
    +
    +

    Returns the object at the given index, or nil if out of bounds. This subscript indexer is typically used for ListMonitors created with monitorList(_:).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(safeIndex index: Int) -> ObjectType? { get }
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + index + + +
    +

    the index for the object. Using an index above the valid range will return nil.

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject at the specified index, or nil if out of bounds

    +
    +
    +
    +
  • +
  • +
    + + + + subscript(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns the object at the given sectionIndex and itemIndex. This subscript indexer is typically used for ListMonitors created with monitorSectionedList(_:).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(sectionIndex: Int, itemIndex: Int) -> ObjectType { get }
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionIndex + + +
    +

    the section index for the object. Using a sectionIndex with an invalid range will raise an exception.

    +
    +
    + + itemIndex + + +
    +

    the index for the object within the section. Using an itemIndex with an invalid range will raise an exception.

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject at the specified section and item index

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the object at the given section and item index, or nil if out of bounds. This subscript indexer is typically used for ListMonitors created with monitorSectionedList(_:).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(safeSectionIndex sectionIndex: Int, safeItemIndex itemIndex: Int) -> ObjectType? { get }
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionIndex + + +
    +

    the section index for the object. Using a sectionIndex with an invalid range will return nil.

    +
    +
    + + itemIndex + + +
    +

    the index for the object within the section. Using an itemIndex with an invalid range will return nil.

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject at the specified section and item index, or nil if out of bounds

    +
    +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the object at the given IndexPath. This subscript indexer is typically used for ListMonitors created with monitorSectionedList(_:).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(indexPath: IndexPath) -> ObjectType { get }
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + indexPath + + +
    +

    the IndexPath for the object. Using an indexPath with an invalid range will raise an exception.

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject at the specified index path

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the object at the given IndexPath, or nil if out of bounds. This subscript indexer is typically used for ListMonitors created with monitorSectionedList(_:).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(safeIndexPath indexPath: IndexPath) -> ObjectType? { get }
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + indexPath + + +
    +

    the IndexPath for the object. Using an indexPath with an invalid range will return nil.

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject at the specified index path, or nil if out of bounds

    +
    +
    +
    +
  • +
  • +
    + + + + hasSections() + +
    +
    +
    +
    +
    +
    +

    Checks if the ListMonitor has at least one section

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hasSections() -> Bool
    + +
    +
    +
    +

    Return Value

    +

    true if at least one section exists, false otherwise

    +
    +
    +
    +
  • +
  • +
    + + + + hasObjects() + +
    +
    +
    +
    +
    +
    +

    Checks if the ListMonitor has at least one object in any section.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hasObjects() -> Bool
    + +
    +
    +
    +

    Return Value

    +

    true if at least one object in any section exists, false otherwise

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Checks if the ListMonitor has at least one object the specified section.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hasObjectsInSection(_ section: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will return false.

    +
    +
    +
    +
    +

    Return Value

    +

    true if at least one object in the specified section exists, false otherwise

    +
    +
    +
    +
  • +
  • +
    + + + + numberOfSections() + +
    +
    +
    +
    +
    +
    +

    Returns the number of sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func numberOfSections() -> Int
    + +
    +
    +
    +

    Return Value

    +

    the number of sections

    +
    +
    +
    +
  • +
  • +
    + + + + numberOfObjects() + +
    +
    +
    +
    +
    +
    +

    Returns the number of objects in all sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func numberOfObjects() -> Int
    + +
    +
    +
    +

    Return Value

    +

    the number of objects in all sections

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the number of objects in the specified section

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func numberOfObjectsInSection(_ section: Int) -> Int
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will raise an exception.

    +
    +
    +
    +
    +

    Return Value

    +

    the number of objects in the specified section

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the number of objects in the specified section, or nil if out of bounds.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func numberOfObjectsInSection(safeSectionIndex section: Int) -> Int?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will return nil.

    +
    +
    +
    +
    +

    Return Value

    +

    the number of objects in the specified section

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the NSFetchedResultsSectionInfo for the specified section

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func sectionInfoAtIndex(_ section: Int) -> NSFetchedResultsSectionInfo
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will raise an exception.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSFetchedResultsSectionInfo for the specified section

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the NSFetchedResultsSectionInfo for the specified section, or nil if out of bounds.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func sectionInfoAtIndex(safeSectionIndex section: Int) -> NSFetchedResultsSectionInfo?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will return nil.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSFetchedResultsSectionInfo for the specified section, or nil if the section index is out of bounds.

    +
    +
    +
    +
  • +
  • +
    + + + + sections() + +
    +
    +
    +
    +
    +
    +

    Returns the NSFetchedResultsSectionInfos for all sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func sections() -> [NSFetchedResultsSectionInfo]
    + +
    +
    +
    +

    Return Value

    +

    the NSFetchedResultsSectionInfos for all sections

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the target section for a specified Section Index title and index.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func targetSectionForSectionIndex(title: String, index: Int) -> Int
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + title + + +
    +

    the title of the Section Index

    +
    +
    + + index + + +
    +

    the index of the Section Index

    +
    +
    +
    +
    +

    Return Value

    +

    the target section for the specified Section Index title and index.

    +
    +
    +
    +
  • +
  • +
    + + + + sectionIndexTitles() + +
    +
    +
    +
    +
    +
    +

    Returns the section index titles for all sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func sectionIndexTitles() -> [String]
    + +
    +
    +
    +

    Return Value

    +

    the section index titles for all sections

    +
    +
    +
    +
  • +
  • +
    + + + + indexOf(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the index of the DynamicObject if it exists in the ListMonitor‘s fetched objects, or nil if not found.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func indexOf(_ object: ObjectType) -> Int?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the DynamicObject to search the index of

    +
    +
    +
    +
    +

    Return Value

    +

    the index of the DynamicObject if it exists in the ListMonitor‘s fetched objects, or nil if not found.

    +
    +
    +
    +
  • +
  • +
    + + + + indexPathOf(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the IndexPath of the DynamicObject if it exists in the ListMonitor‘s fetched objects, or nil if not found.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func indexPathOf(_ object: ObjectType) -> IndexPath?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the DynamicObject to search the index of

    +
    +
    +
    +
    +

    Return Value

    +

    the IndexPath of the DynamicObject if it exists in the ListMonitor‘s fetched objects, or nil if not found.

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + addObserver(_:) + +
    +
    +
    +
    +
    +
    +

    Registers a ListObserver to be notified when changes to the receiver’s list occur.

    + +

    To prevent retain-cycles, ListMonitor only keeps weak references to its observers.

    + +

    For thread safety, this method needs to be called from the main thread. An assertion failure will occur (on debug builds only) if called from any thread other than the main thread.

    + +

    Calling addObserver(_:) multiple times on the same observer is safe, as ListMonitor unregisters previous notifications to the observer before re-registering them.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func addObserver<U>(_ observer: U) where D == U.ListEntityType, U : ListObserver
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + observer + + +
    +

    a ListObserver to send change notifications to

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + addObserver(_:) + +
    +
    +
    +
    +
    +
    +

    Registers a ListObjectObserver to be notified when changes to the receiver’s list occur.

    + +

    To prevent retain-cycles, ListMonitor only keeps weak references to its observers.

    + +

    For thread safety, this method needs to be called from the main thread. An assertion failure will occur (on debug builds only) if called from any thread other than the main thread.

    + +

    Calling addObserver(_:) multiple times on the same observer is safe, as ListMonitor unregisters previous notifications to the observer before re-registering them.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func addObserver<U>(_ observer: U) where D == U.ListEntityType, U : ListObjectObserver
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + observer + + +
    +

    a ListObjectObserver to send change notifications to

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + addObserver(_:) + +
    +
    +
    +
    +
    +
    +

    Registers a ListSectionObserver to be notified when changes to the receiver’s list occur.

    + +

    To prevent retain-cycles, ListMonitor only keeps weak references to its observers.

    + +

    For thread safety, this method needs to be called from the main thread. An assertion failure will occur (on debug builds only) if called from any thread other than the main thread.

    + +

    Calling addObserver(_:) multiple times on the same observer is safe, as ListMonitor unregisters previous notifications to the observer before re-registering them.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func addObserver<U>(_ observer: U) where D == U.ListEntityType, U : ListSectionObserver
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + observer + + +
    +

    a ListSectionObserver to send change notifications to

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + removeObserver(_:) + +
    +
    +
    +
    +
    +
    +

    Unregisters a ListObserver from receiving notifications for changes to the receiver’s list.

    + +

    For thread safety, this method needs to be called from the main thread. An assertion failure will occur (on debug builds only) if called from any thread other than the main thread.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func removeObserver<U>(_ observer: U) where D == U.ListEntityType, U : ListObserver
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + observer + + +
    +

    a ListObserver to unregister notifications to

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + isPendingRefetch + +
    +
    +
    +
    +
    +
    +

    Returns true if a call to refetch(...) was made to the ListMonitor and is currently waiting for the fetching to complete. Returns false otherwise.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) var isPendingRefetch: Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + refetch(_:) + +
    +
    +
    +
    +
    +
    +

    Asks the ListMonitor to refetch its objects using the specified series of FetchClauses. Note that this method does not execute the fetch immediately; the actual fetching will happen after the NSFetchedResultsController‘s last controllerDidChangeContent(_:) notification completes.

    + +

    refetch(...) broadcasts listMonitorWillRefetch(...) to its observers immediately, and then listMonitorDidRefetch(...) after the new fetch request completes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func refetch(_ fetchClauses: FetchClause...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses. Important: Starting CoreStore 4.0, all FetchClauses required by the ListMonitor should be provided in the arguments list of refetch(...).

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + refetch(_:) + +
    +
    +
    +
    +
    +
    +

    Asks the ListMonitor to refetch its objects using the specified series of FetchClauses. Note that this method does not execute the fetch immediately; the actual fetching will happen after the NSFetchedResultsController‘s last controllerDidChangeContent(_:) notification completes.

    + +

    refetch(...) broadcasts listMonitorWillRefetch(...) to its observers immediately, and then listMonitorDidRefetch(...) after the new fetch request completes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func refetch(_ fetchClauses: [FetchClause])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses. Important: Starting CoreStore 4.0, all FetchClauses required by the ListMonitor should be provided in the arguments list of refetch(...).

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + userInfo + +
    +
    +
    +
    +
    +
    +

    Allow external libraries to store custom data in the ListMonitor. App code should rarely have a need for this.

    +
    enum Static {
    +    static var myDataKey: Void?
    +}
    +monitor.userInfo[&Static.myDataKey] = myObject
    +
    +
    +

    Important

    + Do not use this method to store thread-sensitive data. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let userInfo: UserInfo
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: ListMonitor<ObjectType>, rhs: ListMonitor<ObjectType>) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Returns all objects in all sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func objectsInAllSections() -> [ObjectType]
    + +
    +
    +
    +

    Return Value

    +

    all objects in all sections

    +
    +
    +
    +
  • +
  • +
    + + + + objectsInSection(_:) + +
    +
    +
    +
    +
    +
    +

    Returns all objects in the specified section

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func objectsInSection(_ section: Int) -> [ObjectType]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will raise an exception.

    +
    +
    +
    +
    +

    Return Value

    +

    all objects in the specified section

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns all objects in the specified section, or nil if out of bounds.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func objectsInSection(safeSectionIndex section: Int) -> [ObjectType]?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will return nil.

    +
    +
    +
    +
    +

    Return Value

    +

    all objects in the specified section

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Returns all objects in all sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func objectsInAllSections() -> [ObjectType]
    + +
    +
    +
    +

    Return Value

    +

    all objects in all sections

    +
    +
    +
    +
  • +
  • +
    + + + + objectsInSection(_:) + +
    +
    +
    +
    +
    +
    +

    Returns all objects in the specified section

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func objectsInSection(_ section: Int) -> [ObjectType]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will raise an exception.

    +
    +
    +
    +
    +

    Return Value

    +

    all objects in the specified section

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns all objects in the specified section, or nil if out of bounds.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func objectsInSection(safeSectionIndex section: Int) -> [ObjectType]?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will return nil.

    +
    +
    +
    +
    +

    Return Value

    +

    all objects in the specified section

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/ObjectMonitor.html b/docs/Classes/ObjectMonitor.html new file mode 100644 index 0000000..3d70cf4 --- /dev/null +++ b/docs/Classes/ObjectMonitor.html @@ -0,0 +1,1099 @@ + + + + ObjectMonitor Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ObjectMonitor

+
+
+
@available(OSX 10.12, *)
+public final class ObjectMonitor<D> : Equatable where D : DynamicObject
+ +
+
+

The ObjectMonitor monitors changes to a single DynamicObject instance. Observers that implement the ObjectObserver protocol may then register themselves to the ObjectMonitor‘s addObserver(_:) method:

+
let monitor = CoreStore.monitorObject(object)
+monitor.addObserver(self)
+
+ +

The created ObjectMonitor instance needs to be held on (retained) for as long as the object needs to be observed.

+ +

Observers registered via addObserver(_:) are not retained. ObjectMonitor only keeps a weak reference to all observers, thus keeping itself free from retain-cycles.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    +

    The type for the object contained by the ObjectMonitor

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = D
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + object + +
    +
    +
    +
    +
    +
    +

    Returns the DynamicObject instance being observed, or nil if the object was already deleted.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var object: ObjectType? { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + isObjectDeleted + +
    +
    +
    +
    +
    +
    +

    Returns true if the DynamicObject instance being observed still exists, or false if the object was already deleted.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isObjectDeleted: Bool { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + addObserver(_:) + +
    +
    +
    +
    +
    +
    +

    Registers an ObjectObserver to be notified when changes to the receiver’s object are made.

    + +

    To prevent retain-cycles, ObjectMonitor only keeps weak references to its observers.

    + +

    For thread safety, this method needs to be called from the main thread. An assertion failure will occur (on debug builds only) if called from any thread other than the main thread.

    + +

    Calling addObserver(_:) multiple times on the same observer is safe, as ObjectMonitor unregisters previous notifications to the observer before re-registering them.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func addObserver<U>(_ observer: U) where D == U.ObjectEntityType, U : ObjectObserver
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + observer + + +
    +

    an ObjectObserver to send change notifications to

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + removeObserver(_:) + +
    +
    +
    +
    +
    +
    +

    Unregisters an ObjectObserver from receiving notifications for changes to the receiver’s object.

    + +

    For thread safety, this method needs to be called from the main thread. An assertion failure will occur (on debug builds only) if called from any thread other than the main thread.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func removeObserver<U>(_ observer: U) where D == U.ObjectEntityType, U : ObjectObserver
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + observer + + +
    +

    an ObjectObserver to unregister notifications to

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + userInfo + +
    +
    +
    +
    +
    +
    +

    Allow external libraries to store custom data in the ObjectMonitor. App code should rarely have a need for this.

    +
    enum Static {
    +    static var myDataKey: Void?
    +}
    +monitor.userInfo[&Static.myDataKey] = myObject
    +
    +
    +

    Important

    + Do not use this method to store thread-sensitive data. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let userInfo: UserInfo
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: ObjectMonitor<ObjectType>, rhs: ObjectMonitor<ObjectType>) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/SQLiteStore.html b/docs/Classes/SQLiteStore.html new file mode 100644 index 0000000..46abcdd --- /dev/null +++ b/docs/Classes/SQLiteStore.html @@ -0,0 +1,1524 @@ + + + + SQLiteStore Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SQLiteStore

+
+
+
public final class SQLiteStore : LocalStorage
+ +
+
+

A storage interface that is backed by an SQLite database.

+
+

Warning

+ The default SQLite file location for the LegacySQLiteStore and SQLiteStore are different. If the app was depending on CoreStore’s default directories prior to 2.0.0, make sure to use the SQLiteStore.legacy(...) factory methods to create the SQLiteStore instead of using initializers directly. + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes an SQLite store interface from the given SQLite file URL. When this instance is passed to the DataStack‘s addStorage() methods, a new SQLite file will be created if it does not exist.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(fileURL: URL, configuration: ModelConfiguration = nil, migrationMappingProviders: [SchemaMappingProvider] = [], localStorageOptions: LocalStorageOptions = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + fileURL + + +
    +

    the local file URL for the target SQLite persistent store. Note that if you have multiple configurations, you will need to specify a different fileURL explicitly for each of them.

    +
    +
    + + configuration + + +
    +

    an optional configuration name from the model file. If not specified, defaults to nil, the Default configuration. Note that if you have multiple configurations, you will need to specify a different fileURL explicitly for each of them.

    +
    +
    + + migrationMappingProviders + + +
    +

    an array of SchemaMappingProviders that provides the complete mapping models for custom migrations. All lightweight inferred mappings and/or migration mappings provided by *xcmappingmodel files are automatically used as fallback (as InferredSchemaMappingProvider) and may be omitted from the array.

    +
    +
    + + localStorageOptions + + +
    +

    When the SQLiteStore is passed to the DataStack‘s addStorage() methods, tells the DataStack how to setup the persistent store. Defaults to .none.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes an SQLite store interface from the given SQLite file name. When this instance is passed to the DataStack‘s addStorage() methods, a new SQLite file will be created if it does not exist.

    +
    +

    Warning

    + The default SQLite file location for the LegacySQLiteStore and SQLiteStore are different. If the app was depending on CoreStore’s default directories prior to 2.0.0, make sure to use the SQLiteStore.legacy(...) factory methods to create the SQLiteStore instead of using initializers directly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(fileName: String, configuration: ModelConfiguration = nil, migrationMappingProviders: [SchemaMappingProvider] = [], localStorageOptions: LocalStorageOptions = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + fileName + + +
    +

    the local filename for the SQLite persistent store in the Application Support/ directory (or the Caches/ directory on tvOS). Note that if you have multiple configurations, you will need to specify a different fileName explicitly for each of them.

    +
    +
    + + configuration + + +
    +

    an optional configuration name from the model file. If not specified, defaults to nil, the Default configuration. Note that if you have multiple configurations, you will need to specify a different fileName explicitly for each of them.

    +
    +
    + + migrationMappingProviders + + +
    +

    an array of SchemaMappingProviders that provides the complete mapping models for custom migrations. All lightweight inferred mappings and/or migration mappings provided by *xcmappingmodel files are automatically used as fallback (as InferredSchemaMappingProvider) and may be omitted from the array.

    +
    +
    + + localStorageOptions + + +
    +

    When the SQLiteStore is passed to the DataStack‘s addStorage() methods, tells the DataStack how to setup the persistent store. Defaults to .None.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes an SQLiteStore with an all-default settings: a fileURL pointing to a .sqlite file in the Application Support/ directory (or the Caches/ directory on tvOS), a nil configuration pertaining to the Default configuration, a migrationMappingProviders set to empty, and localStorageOptions set to .AllowProgresiveMigration.

    +
    +

    Warning

    + The default SQLite file location for the LegacySQLiteStore and SQLiteStore are different. If the app was depending on CoreStore’s default directories prior to 2.0.0, make sure to use the SQLiteStore.legacy(...) factory methods to create the SQLiteStore instead of using initializers directly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes an SQLite store interface from the given SQLite file name. When this instance is passed to the DataStack‘s addStorage() methods, a new SQLite file will be created if it does not exist.

    +
    +

    Warning

    + The default SQLite file location for the LegacySQLiteStore and SQLiteStore are different. If the app was depending on CoreStore’s default directories prior to 2.0.0, make sure to use the SQLiteStore.legacy(...) factory methods to create the SQLiteStore instead of using initializers directly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func legacy(fileName: String, configuration: ModelConfiguration = nil, migrationMappingProviders: [SchemaMappingProvider] = [], localStorageOptions: LocalStorageOptions = nil) -> SQLiteStore
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + legacyFileName + + +
    +

    the local filename for the SQLite persistent store in the Application Support directory (or the Caches directory on tvOS). Note that if you have multiple configurations, you will need to specify a different fileName explicitly for each of them.

    +
    +
    + + configuration + + +
    +

    an optional configuration name from the model file. If not specified, defaults to nil, the Default configuration. Note that if you have multiple configurations, you will need to specify a different fileName explicitly for each of them.

    +
    +
    + + migrationMappingProviders + + +
    +

    an array of SchemaMappingProviders that provides the complete mapping models for custom migrations. All lightweight inferred mappings and/or migration mappings provided by *xcmappingmodel files are automatically used as fallback (as InferredSchemaMappingProvider) and may be omitted from the array.

    +
    +
    + + localStorageOptions + + +
    +

    When the SQLiteStore is passed to the DataStack‘s addStorage() methods, tells the DataStack how to setup the persistent store. Defaults to .None.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + legacy() + +
    +
    +
    +
    +
    +
    +

    Initializes an LegacySQLiteStore with an all-default settings: a fileURL pointing to a .sqlite file in the Application Support directory (or the Caches directory on tvOS), a nil configuration pertaining to the Default configuration, a migrationMappingProviders set to empty, and localStorageOptions set to .AllowProgresiveMigration.

    +
    +

    Warning

    + The default SQLite file location for the LegacySQLiteStore and SQLiteStore are different. If the app was depending on CoreStore’s default directories prior to 2.0.0, make sure to use the SQLiteStore.legacy(...) factory methods to create the SQLiteStore instead of using initializers directly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func legacy() -> SQLiteStore
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fileSize() + +
    +
    +
    +
    +
    +
    +

    Queries the file size (in bytes) of the store, or nil if the file does not exist yet

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fileSize() -> UInt64?
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + storeType + +
    +
    +
    +
    +
    +
    +

    The string identifier for the NSPersistentStore‘s type property. For SQLiteStores, this is always set to NSSQLiteStoreType.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let storeType: String
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    +

    The configuration name in the model file

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let configuration: ModelConfiguration
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + storeOptions + +
    +
    +
    +
    +
    +
    +

    The options dictionary for the NSPersistentStore. For SQLiteStores, this is always set to

    +
    [NSSQLitePragmasOption: ["journal_mode": "WAL"]]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let storeOptions: [AnyHashable : Any]?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Do not call directly. Used by the DataStack internally.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cs_didAddToDataStack(_ dataStack: DataStack)
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Do not call directly. Used by the DataStack internally.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cs_didRemoveFromDataStack(_ dataStack: DataStack)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fileURL + +
    +
    +
    +
    +
    +
    +

    The NSURL that points to the SQLite file

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let fileURL: URL
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    An array of SchemaMappingProviders that provides the complete mapping models for custom migrations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let migrationMappingProviders: [SchemaMappingProvider]
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + localStorageOptions + +
    +
    +
    +
    +
    +
    +

    Options that tell the DataStack how to setup the persistent store

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var localStorageOptions: LocalStorageOptions
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The options dictionary for the specified LocalStorageOptions

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func dictionary(forOptions options: LocalStorageOptions) -> [AnyHashable : Any]?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Called by the DataStack to perform checkpoint operations on the storage. For SQLiteStore, this converts the database’s WAL journaling mode to DELETE to force a checkpoint.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cs_finalizeStorageAndWait(soureModelHint: NSManagedObjectModel) throws
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Called by the DataStack to perform actual deletion of the store file from disk. Do not call directly! The sourceModel argument is a hint for the existing store’s model version. For SQLiteStore, this converts the database’s WAL journaling mode to DELETE before deleting the file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cs_eraseStorageAndWait(metadata: [String : Any], soureModelHint: NSManagedObjectModel?) throws
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/SchemaHistory.html b/docs/Classes/SchemaHistory.html new file mode 100644 index 0000000..f9b1ef9 --- /dev/null +++ b/docs/Classes/SchemaHistory.html @@ -0,0 +1,1153 @@ + + + + SchemaHistory Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SchemaHistory

+
+
+
public final class SchemaHistory : ExpressibleByArrayLiteral
+ +
+
+

The SchemaHistory encapsulates multiple DynamicSchema across multiple model versions. It contains all model history and is used by the DataStack to

+ +
+
+ +
+
+
+
    +
  • +
    + + + + currentModelVersion + +
    +
    +
    +
    +
    +
    +

    The version string for the current model version. The DataStack will try to migrate all StorageInterfaces added to itself to this version, following the version steps provided by the migrationChain.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let currentModelVersion: ModelVersion
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + currentSchema + +
    +
    +
    +
    +
    +
    +

    The schema for the current model version. The DataStack will try to migrate all StorageInterfaces added to itself to this version, following the version steps provided by the migrationChain.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var currentSchema: DynamicSchema { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + migrationChain + +
    +
    +
    +
    +
    +
    +

    The version string for the current model version. The DataStack will try to migrate all StorageInterfaces added to itself to this version, following the version steps provided by the migrationChain.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let migrationChain: MigrationChain
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Convenience initializer for a SchemaHistory created from a single xcdatamodeld file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(_ xcodeDataModeld: (allSchema: [XcodeDataModelSchema], currentModelVersion: ModelVersion), migrationChain: MigrationChain = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + xcodeDataModeld + + +
    +

    a tuple returned from the XcodeDataModelSchema.from(modelName:bundle:migrationChain:) method.

    +
    +
    + + migrationChain + + +
    +

    the MigrationChain that indicates the sequence of model versions to be used as the order for progressive migrations. If not specified, will default to a non-migrating data stack.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a SchemaHistory with a list of DynamicSchema and a MigrationChain to describe the order of progressive migrations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(_ schema: DynamicSchema, _ otherSchema: DynamicSchema..., migrationChain: MigrationChain = nil, exactCurrentModelVersion: String? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + schema + + +
    +

    a DynamicSchema that represents a model version

    +
    +
    + + otherSchema + + +
    +

    a list of DynamicSchema that represent other model versions

    +
    +
    + + migrationChain + + +
    +

    the MigrationChain that indicates the sequence of model versions to be used as the order for progressive migrations. If not specified, will default to a non-migrating data stack.

    +
    +
    + + exactCurrentModelVersion + + +
    +

    an optional string to explicitly select the current model version string. This is useful if the DataStack should load a non-latest model version (usually to prepare data before migration). If not provided, the current model version will be computed from the MigrationChain.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a SchemaHistory with a list of DynamicSchema and a MigrationChain to describe the order of progressive migrations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init(allSchema: [DynamicSchema], migrationChain: MigrationChain = nil, exactCurrentModelVersion: String? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + allSchema + + +
    +

    a list of DynamicSchema that represent model versions

    +
    +
    + + migrationChain + + +
    +

    the MigrationChain that indicates the sequence of model versions to be used as the order for progressive migrations. If not specified, will default to a non-migrating data stack.

    +
    +
    + + exactCurrentModelVersion + + +
    +

    an optional string to explicitly select the current model version string. This is useful if the DataStack should load a non-latest model version (usually to prepare data before migration). If not provided, the current model version will be computed from the MigrationChain.

    +
    +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/SynchronousDataTransaction.html b/docs/Classes/SynchronousDataTransaction.html new file mode 100644 index 0000000..c8146f0 --- /dev/null +++ b/docs/Classes/SynchronousDataTransaction.html @@ -0,0 +1,1231 @@ + + + + SynchronousDataTransaction Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SynchronousDataTransaction

+
+
+
public final class SynchronousDataTransaction : BaseDataTransaction
+ +
+
+

The SynchronousDataTransaction provides an interface for DynamicObject creates, updates, and deletes. A transaction object should typically be only used from within a transaction block initiated from DataStack.beginSynchronous(_:), or from CoreStore.beginSynchronous(_:).

+ +
+
+ +
+
+
+
    +
  • +
    + + + + cancel() + +
    +
    +
    +
    +
    +
    +

    Cancels a transaction by throwing CoreStoreError.userCancelled.

    +
    try transaction.cancel()
    +
    +
    +

    Important

    + Always use plain try on a cancel() call. Never use try? or try!. Using try? will swallow the cancellation and the transaction will proceed to commit as normal. Using try! will crash the app as cancel() will always throw an error. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cancel() throws -> Never
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + create(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a new NSManagedObject or CoreStoreObject with the specified entity type.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override func create<D>(_ into: Into<D>) -> D where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + into + + +
    +

    the Into clause indicating the destination NSManagedObject or CoreStoreObject entity type and the destination configuration

    +
    +
    +
    +
    +

    Return Value

    +

    a new NSManagedObject or CoreStoreObject instance of the specified entity type.

    +
    +
    +
    +
  • +
  • +
    + + + + edit(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an editable proxy of a specified NSManagedObject or CoreStoreObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override func edit<D>(_ object: D?) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject or CoreStoreObject to be edited

    +
    +
    +
    +
    +

    Return Value

    +

    an editable proxy for the specified NSManagedObject or CoreStoreObject.

    +
    +
    +
    +
  • +
  • +
    + + + + edit(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an editable proxy of the object with the specified NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override func edit<D>(_ into: Into<D>, _ objectID: NSManagedObjectID) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + into + + +
    +

    an Into clause specifying the entity type

    +
    +
    + + objectID + + +
    +

    the NSManagedObjectID for the object to be edited

    +
    +
    +
    +
    +

    Return Value

    +

    an editable proxy for the specified NSManagedObject or CoreStoreObject.

    +
    +
    +
    +
  • +
  • +
    + + + + delete(_:) + +
    +
    +
    +
    +
    +
    +

    Deletes a specified NSManagedObject or CoreStoreObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override func delete<D>(_ object: D?) where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject or CoreStoreObject type to be deleted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + delete(_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Deletes the specified DynamicObjects.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override func delete<D>(_ object1: D?, _ object2: D?, _ objects: D?...) where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + object1 + + +
    +

    the DynamicObject to be deleted

    +
    +
    + + object2 + + +
    +

    another DynamicObject to be deleted

    +
    +
    + + objects + + +
    +

    other DynamicObjects to be deleted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + delete(_:) + +
    +
    +
    +
    +
    +
    +

    Deletes the specified DynamicObjects.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override func delete<S>(_ objects: S) where S : Sequence, S.Element : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objects + + +
    +

    the DynamicObjects to be deleted

    +
    +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/UnsafeDataModelSchema.html b/docs/Classes/UnsafeDataModelSchema.html new file mode 100644 index 0000000..157b479 --- /dev/null +++ b/docs/Classes/UnsafeDataModelSchema.html @@ -0,0 +1,987 @@ + + + + UnsafeDataModelSchema Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

UnsafeDataModelSchema

+
+
+
public final class UnsafeDataModelSchema : DynamicSchema
+ +
+
+

The UnsafeDataModelSchema describes models loaded directly from an existing NSManagedObjectModel. It is not advisable to continue using this model as its metadata are not available to CoreStore.

+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes a UnsafeDataModelSchema from an NSManagedObjectModel.

    +
    CoreStore.defaultStack = DataStack(
    +    UnsafeDataModelSchema(modelName: "MyAppV1", model: model)
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init(modelName: ModelVersion, model: NSManagedObjectModel)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + modelName + + +
    +

    the model version, typically the file name of an *.xcdatamodeld file (without the file extension)

    +
    +
    + + model + + +
    +

    the NSManagedObjectModel

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + modelVersion + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let modelVersion: ModelVersion
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + rawModel() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func rawModel() -> NSManagedObjectModel
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/UnsafeDataTransaction.html b/docs/Classes/UnsafeDataTransaction.html new file mode 100644 index 0000000..7d18082 --- /dev/null +++ b/docs/Classes/UnsafeDataTransaction.html @@ -0,0 +1,2281 @@ + + + + UnsafeDataTransaction Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

UnsafeDataTransaction

+
+
+
public final class UnsafeDataTransaction : BaseDataTransaction
+ +
+
+

The UnsafeDataTransaction provides an interface for non-contiguous NSManagedObject or CoreStoreObject creates, updates, and deletes. This is useful for making temporary changes, such as partially filled forms. An unsafe transaction object should typically be only used from the main queue.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + commit(_:) + +
    +
    +
    +
    +
    +
    +

    Saves the transaction changes asynchronously. For an UnsafeDataTransaction, multiple commits are allowed, although it is the developer’s responsibility to ensure a reasonable leeway to prevent blocking the main thread.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func commit(_ completion: @escaping (_ error: CoreStoreError?) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + completion + + +
    +

    the block executed after the save completes. Success or failure is reported by the optional error argument of the block.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + commitAndWait() + +
    +
    +
    +
    +
    +
    +

    Saves the transaction changes and waits for completion synchronously. For an UnsafeDataTransaction, multiple commits are allowed, although it is the developer’s responsibility to ensure a reasonable leeway to prevent blocking the main thread.

    +
    +

    Throws

    + a CoreStoreError value indicating the failure. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func commitAndWait() throws
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + rollback() + +
    +
    +
    +
    +
    +
    +

    Rolls back the transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func rollback()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + undo() + +
    +
    +
    +
    +
    +
    +

    Undo’s the last change made to the transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func undo()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + flush() + +
    +
    +
    +
    +
    +
    +

    Immediately flushes all pending changes to the transaction’s observers. This is useful in conjunction with ListMonitors and ObjectMonitors created from UnsafeDataTransactions used to manage temporary scratch data.

    +
    +

    Important

    + Note that unlike commit(), flush() does not propagate/save updates to the DataStack and the persistent store. However, the flushed changes will be seen by children transactions created further from the current transaction (i.e. through transaction.beginUnsafe()) + +
    +
    +

    Throws

    + an error thrown from closure, or an error thrown by Core Data (usually validation errors or conflict errors) + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func flush()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + flush(closure:) + +
    +
    +
    +
    +
    +
    +

    Flushes all pending changes to the transaction’s observers at the end of the closure‘s execution. This is useful in conjunction with ListMonitors and ObjectMonitors created from UnsafeDataTransactions used to manage temporary scratch data.

    +
    +

    Important

    + Note that unlike commit(), flush() does not propagate/save updates to the DataStack and the persistent store. However, the flushed changes will be seen by children transactions created further from the current transaction (i.e. through transaction.beginUnsafe()) + +
    +
    +

    Throws

    + an error thrown from closure, or an error thrown by Core Data (usually validation errors or conflict errors) + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func flush(closure: () throws -> Void) rethrows
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + closure + + +
    +

    the closure where changes can be made prior to the flush

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + redo() + +
    +
    +
    +
    +
    +
    +

    Redo’s the last undone change to the transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func redo()
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Begins a child transaction where NSManagedObject or CoreStoreObject creates, updates, and deletes can be made. This is useful for making temporary changes, such as partially filled forms.

    + +
      +
    • prameter supportsUndo: undo(), redo(), and rollback() methods are only available when this parameter is true, otherwise those method will raise an exception. Defaults to false. Note that turning on Undo support may heavily impact performance especially on iOS or watchOS where memory is limited.
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func beginUnsafe(supportsUndo: Bool = false) -> UnsafeDataTransaction
    + +
    +
    +
    +

    Return Value

    +

    an UnsafeDataTransaction instance where creates, updates, and deletes can be made.

    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Utility for creating an NSFetchedResultsController from the UnsafeDataTransaction. This is useful when an NSFetchedResultsController is preferred over the overhead of ListMonitors abstraction.

    +
    +

    Note

    +

    It is the caller’s responsibility to call performFetch() on the created NSFetchedResultsController.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func createFetchedResultsController<D>(_ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: FetchClause...) -> NSFetchedResultsController<D> where D : NSManagedObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    an NSFetchedResultsController that observes the UnsafeDataTransaction

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Utility for creating an NSFetchedResultsController from the UnsafeDataTransaction. This is useful when an NSFetchedResultsController is preferred over the overhead of ListMonitors abstraction.

    +
    +

    Note

    +

    It is the caller’s responsibility to call performFetch() on the created NSFetchedResultsController.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func createFetchedResultsController<D>(_ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: [FetchClause]) -> NSFetchedResultsController<D> where D : NSManagedObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    an NSFetchedResultsController that observes the UnsafeDataTransaction

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Utility for creating an NSFetchedResultsController from the UnsafeDataTransaction. This is useful when an NSFetchedResultsController is preferred over the overhead of ListMonitors abstraction.

    +
    +

    Note

    +

    It is the caller’s responsibility to call performFetch() on the created NSFetchedResultsController.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func createFetchedResultsController<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> NSFetchedResultsController<D> where D : NSManagedObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    an NSFetchedResultsController that observes the UnsafeDataTransaction

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Utility for creating an NSFetchedResultsController from the UnsafeDataTransaction. This is useful when an NSFetchedResultsController is preferred over the overhead of ListMonitors abstraction.

    +
    +

    Note

    +

    It is the caller’s responsibility to call performFetch() on the created NSFetchedResultsController.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func createFetchedResultsController<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> NSFetchedResultsController<D> where D : NSManagedObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    an NSFetchedResultsController that observes the UnsafeDataTransaction

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + monitorObject(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ObjectMonitor for the specified DynamicObject. Multiple ObjectObservers may then register themselves to be notified when changes are made to the DynamicObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorObject<D>(_ object: D) -> ObjectMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the DynamicObject to observe changes from

    +
    +
    +
    +
    +

    Return Value

    +

    a ObjectMonitor that monitors changes to object

    +
    +
    +
    +
  • +
  • +
    + + + + monitorList(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ListMonitor for a list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorList<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> ListMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • +
    + + + + monitorList(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ListMonitor for a list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorList<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> ListMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • +
    + + + + monitorList(_:) + +
    +
    +
    +
    +
    +
    +

    Asynchronously creates a ListMonitor for a list of DynamicObjects that satisfy the specified FetchChainableBuilderType built from a chain of clauses. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    +
    transaction.monitorList(
    +    { (monitor) in
    +        self.monitor = monitor
    +    },
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorList<B>(_ clauseChain: B) -> ListMonitor<B.ObjectType> where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor for a list of DynamicObjects that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a ListMonitor for a list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorList<D>(createAsynchronously: @escaping (ListMonitor<D>) -> Void, _ from: From<D>, _ fetchClauses: FetchClause...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a ListMonitor for a list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorList<D>(createAsynchronously: @escaping (ListMonitor<D>) -> Void, _ from: From<D>, _ fetchClauses: [FetchClause])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorSectionedList<D>(_ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: FetchClause...) -> ListMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorSectionedList<D>(_ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: [FetchClause]) -> ListMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified SectionMonitorBuilderType built from a chain of clauses.

    +
    let monitor = transaction.monitorSectionedList(
    +    From<MyPersonEntity>()
    +        .sectionBy(\.age, { "\($0!) years old" })
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorSectionedList<B>(_ clauseChain: B) -> ListMonitor<B.ObjectType> where B : SectionMonitorBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a SectionMonitorBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor for a list of DynamicObjects that satisfy the specified SectionMonitorBuilderType

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorSectionedList<D>(createAsynchronously: @escaping (ListMonitor<D>) -> Void, _ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: FetchClause...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorSectionedList<D>(createAsynchronously: @escaping (ListMonitor<D>) -> Void, _ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: [FetchClause])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified SectionMonitorBuilderType built from a chain of clauses.

    +
    transaction.monitorSectionedList(
    +    { (monitor) in
    +        self.monitor = monitor
    +    },
    +    From<MyPersonEntity>()
    +        .sectionBy(\.age, { "\($0!) years old" })
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorSectionedList<B: SectionMonitorBuilderType>(createAsynchronously: @escaping (ListMonitor<B.ObjectType>) -> Void, _ clauseChain: B)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a SectionMonitorBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor for a list of DynamicObjects that satisfy the specified SectionMonitorBuilderType

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/UserInfo.html b/docs/Classes/UserInfo.html new file mode 100644 index 0000000..ea5b658 --- /dev/null +++ b/docs/Classes/UserInfo.html @@ -0,0 +1,926 @@ + + + + UserInfo Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

UserInfo

+
+
+
public final class UserInfo
+ +
+
+

The UserInfo class is provided by several CoreStore types such as DataStack, ListMonitor, ObjectMonitor and transactions to allow external libraries or user apps to store their own custom data.

+
enum Static {
+    static var myDataKey: Void?
+}
+CoreStore.defaultStack.userInfo[&Static.myDataKey] = myObject
+
+
+

Important

+ Do not use this class to store thread-sensitive data. + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Allows external libraries to store custom data. App code should rarely have a need for this.

    +
    enum Static {
    +   static var myDataKey: Void?
    +}
    +CoreStore.defaultStack.userInfo[&Static.myDataKey] = myObject
    +
    +
    +

    Important

    + Do not use this method to store thread-sensitive data. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(key: UnsafeRawPointer) -> Any? { get set }
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + key + + +
    +

    the key for custom data. Make sure this is a static pointer that will never be changed.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Allows external libraries to store custom data in the DataStack. App code should rarely have a need for this.

    +
    enum Static {
    +    static var myDataKey: Void?
    +}
    +CoreStore.defaultStack.userInfo[&Static.myDataKey, lazyInit: { MyObject() }] = myObject
    +
    +
    +

    Important

    + Do not use this method to store thread-sensitive data. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(key: UnsafeRawPointer, lazyInit closure: () -> Any) -> Any { get }
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + key + + +
    +

    the key for custom data. Make sure this is a static pointer that will never be changed.

    +
    +
    + + lazyInit + + +
    +

    a closure to use to lazily-initialize the data

    +
    +
    +
    +
    +

    Return Value

    +

    A custom data identified by key

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/XcodeDataModelSchema.html b/docs/Classes/XcodeDataModelSchema.html new file mode 100644 index 0000000..6cdf3bf --- /dev/null +++ b/docs/Classes/XcodeDataModelSchema.html @@ -0,0 +1,1127 @@ + + + + XcodeDataModelSchema Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

XcodeDataModelSchema

+
+
+
public final class XcodeDataModelSchema : DynamicSchema
+ +
+
+

The XcodeDataModelSchema describes a model version declared in a single *.xcdatamodeld file.

+
CoreStore.defaultStack = DataStack(
+    XcodeDataModelSchema(modelName: "MyAppV1", bundle: .main)
+)
+
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Creates a XcodeDataModelSchema for each of the models declared in the specified (.xcdatamodeld) model file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func from(modelName: XcodeDataModelFileName, bundle: Bundle = Bundle.main, migrationChain: MigrationChain = nil) -> (allSchema: [XcodeDataModelSchema], currentModelVersion: ModelVersion)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + modelName + + +
    +

    the name of the (.xcdatamodeld) model file. If not specified, the application name (CFBundleName) will be used if it exists, or CoreData if it the bundle name was not set.

    +
    +
    + + bundle + + +
    +

    an optional bundle to load models from. If not specified, the main bundle will be used.

    +
    +
    + + migrationChain + + +
    +

    the MigrationChain that indicates the sequence of model versions to be used as the order for progressive migrations. If not specified, will default to a non-migrating data stack.

    +
    +
    +
    +
    +

    Return Value

    +

    a tuple containing all XcodeDataModelSchema for the models declared in the specified .xcdatamodeld file, and the current model version string declared or inferred from the file.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes an XcodeDataModelSchema from an *.xcdatamodeld version name and its containing Bundle.

    +
    CoreStore.defaultStack = DataStack(
    +    XcodeDataModelSchema(modelName: "MyAppV1", bundle: .main)
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(modelName: ModelVersion, bundle: Bundle = Bundle.main)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + modelName + + +
    +

    the model version, typically the file name of an *.xcdatamodeld file (without the file extension)

    +
    +
    + + bundle + + +
    +

    the Bundle that contains the .xcdatamodeld’s momd file. If not specified, the Bundle.main will be searched.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes an XcodeDataModelSchema from an *.xcdatamodeld file URL.

    +
    CoreStore.defaultStack = DataStack(
    +    XcodeDataModelSchema(modelName: "MyAppV1", modelVersionFileURL: fileURL)
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init(modelName: ModelVersion, modelVersionFileURL: URL)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + modelName + + +
    +

    the model version, typically the file name of an *.xcdatamodeld file (without the file extension)

    +
    +
    + + modelVersionFileURL + + +
    +

    the file URL that points to the .xcdatamodeld’s momd file.

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + modelVersion + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let modelVersion: ModelVersion
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + rawModel() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func rawModel() -> NSManagedObjectModel
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Classes/XcodeSchemaMappingProvider.html b/docs/Classes/XcodeSchemaMappingProvider.html new file mode 100644 index 0000000..0b422eb --- /dev/null +++ b/docs/Classes/XcodeSchemaMappingProvider.html @@ -0,0 +1,1050 @@ + + + + XcodeSchemaMappingProvider Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

XcodeSchemaMappingProvider

+
+
+
public final class XcodeSchemaMappingProvider : Hashable, SchemaMappingProvider
+ +
+
+

A SchemaMappingProvider that tries to infer model migration between two DynamicSchema versions by loading an xcmappingmodel file from the specified Bundle. Throws CoreStoreError.mappingModelNotFound if the xcmappingmodel file cannot be found, or if the xcmappingmodel doesn’t resolve the source and destination DynamicSchema.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + sourceVersion + +
    +
    +
    +
    +
    +
    +

    The source model version for the mapping.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let sourceVersion: ModelVersion
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + destinationVersion + +
    +
    +
    +
    +
    +
    +

    The destination model version for the mapping.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let destinationVersion: ModelVersion
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + mappingModelBundle + +
    +
    +
    +
    +
    +
    +

    The Bundle that contains the xcmappingmodel file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let mappingModelBundle: Bundle
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates an XcodeSchemaMappingProvider

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init(from sourceVersion: ModelVersion, to destinationVersion: ModelVersion, mappingModelBundle: Bundle)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + sourceVersion + + +
    +

    the source model version for the mapping

    +
    +
    + + destinationVersion + + +
    +

    the destination model version for the mapping

    +
    +
    + + mappingModelBundle + + +
    +

    the Bundle that contains the xcmappingmodel file

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: XcodeSchemaMappingProvider, rhs: XcodeSchemaMappingProvider) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+
+ +
+
+ + + + diff --git a/docs/Enums.html b/docs/Enums.html new file mode 100644 index 0000000..8f039a1 --- /dev/null +++ b/docs/Enums.html @@ -0,0 +1,1357 @@ + + + + Enumerations Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Enumerations

+

The following enumerations are available globally.

+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + CSErrorCode + +
    +
    +
    +
    +
    +
    +

    The NSError error codes for CSError.Domain.

    +
    +

    See also

    + CSError + +
    +
    +

    See also

    + CoreStoreError + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public enum CSErrorCode : Int
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CoreStoreError + +
    +
    +
    +
    +
    +
    +

    All errors thrown from CoreStore are expressed in CoreStoreError enum values.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum CoreStoreError : Error, CustomNSError, Hashable
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + MigrationResult + +
    +
    +
    +
    +
    +
    +

    The MigrationResult indicates the result of a migration. +The MigrationResult can be treated as a boolean:

    +
    CoreStore.upgradeStorageIfNeeded(SQLiteStorage(fileName: "data.sqlite")) { (result) in
    +    switch result {
    +    case .success(let migrationSteps):
    +        // ...
    +    case .failure(let error):
    +        // ...
    +    }
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum MigrationResult : Hashable
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + MigrationType + +
    +
    +
    +
    +
    +
    +

    The MigrationType specifies the type of migration required for a store.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum MigrationType : Hashable
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + SelectTerm + +
    +
    +
    +
    +
    +
    +

    The SelectTerm is passed to the Select clause to indicate the attributes/aggregate keys to be queried.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum SelectTerm<D> : ExpressibleByStringLiteral, Hashable where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + SetupResult + +
    +
    +
    +
    +
    +
    +

    The SetupResult indicates the result of an asynchronous initialization of a persistent store. +The SetupResult can be treated as a boolean:

    +
    try! CoreStore.addStorage(
    +    SQLiteStore(),
    +    completion: { (result: SetupResult) -> Void in
    +        if result {
    +            // succeeded
    +        }
    +        else {
    +            // failed
    +        }
    +    }
    +)
    +
    + +

    or as an enum, where the resulting associated object can also be inspected:

    +
    try! CoreStore.addStorage(
    +    SQLiteStore(),
    +    completion: { (result: SetupResult) -> Void in
    +        switch result {
    +        case .success(let storage):
    +            // storage is the related StorageInterface instance
    +        case .failure(let error):
    +            // error is the CoreStoreError enum value for the failure
    +        }
    +    }
    +)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum SetupResult<T> : Hashable where T : StorageInterface
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CoreStore + +
    +
    +
    +
    +
    +
    +

    CoreStore is the main entry point for all other APIs.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum CoreStore
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + LogLevel + +
    +
    +
    +
    +
    +
    +

    The LogLevel indicates the severity of a log message.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum LogLevel
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ValueContainer + +
    +
    +
    +
    +
    +
    +

    The containing type for value properties. Use the DynamicObject.Value typealias instead for shorter syntax.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let nickname = Value.Optional<String>("nickname")
    +    let color = Transformable.Optional<UIColor>("color")
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum ValueContainer<O> where O : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    The containing type for transformable properties. Use the DynamicObject.Transformable typealias instead for shorter syntax.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let nickname = Value.Optional<String>("nickname")
    +    let color = Transformable.Optional<UIColor>("color")
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum TransformableContainer<O> where O : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + RelationshipContainer + +
    +
    +
    +
    +
    +
    +

    The containing type for relationships. Use the DynamicObject.Relationship typealias instead for shorter syntax.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyUnordered<Dog>("pets", inverse: { $0.master })
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum RelationshipContainer<O> where O : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Enums/CSErrorCode.html b/docs/Enums/CSErrorCode.html new file mode 100644 index 0000000..54c729c --- /dev/null +++ b/docs/Enums/CSErrorCode.html @@ -0,0 +1,988 @@ + + + + CSErrorCode Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSErrorCode

+
+
+
@objc
+public enum CSErrorCode : Int
+ +
+
+

The NSError error codes for CSError.Domain.

+
+

See also

+ CSError + +
+
+

See also

+ CoreStoreError + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + unknownError + +
    +
    +
    +
    +
    +
    +

    A failure occured because of an unknown error.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case unknownError
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The NSPersistentStore could note be initialized because another store existed at the specified NSURL.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case differentStorageExistsAtURL
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + mappingModelNotFound + +
    +
    +
    +
    +
    +
    +

    An NSMappingModel could not be found for a specific source and destination model versions.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case mappingModelNotFound
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Progressive migrations are disabled for a store, but an NSMappingModel could not be found for a specific source and destination model versions.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case progressiveMigrationRequired
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + internalError + +
    +
    +
    +
    +
    +
    +

    An internal SDK call failed with the specified NSError userInfo key.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case internalError
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + userError + +
    +
    +
    +
    +
    +
    +

    The transaction was terminated by a user-thrown error with the specified Error userInfo key.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case userError
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + userCancelled + +
    +
    +
    +
    +
    +
    +

    The transaction was cancelled by the user.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case userCancelled
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Enums/CSLocalStorageOptions.html b/docs/Enums/CSLocalStorageOptions.html new file mode 100644 index 0000000..47b940b --- /dev/null +++ b/docs/Enums/CSLocalStorageOptions.html @@ -0,0 +1,902 @@ + + + + CSLocalStorageOptions Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSLocalStorageOptions

+
+
+
@objc
+public enum CSLocalStorageOptions : Int
+ +
+
+

The CSLocalStorageOptions provides settings that tells the CSDataStack how to setup the persistent store for CSLocalStorage implementers.

+
+

See also

+ LocalStorageOptions + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + none + +
    +
    +
    +
    +
    +
    +

    Tells the DataStack that the store should not be migrated or recreated, and should simply fail on model mismatch

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case none = 0
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Tells the DataStack to delete and recreate the store on model mismatch, otherwise exceptions will be thrown on failure instead

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case recreateStoreOnModelMismatch = 1
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Tells the DataStack to prevent progressive migrations for the store

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case preventProgressiveMigration = 2
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Tells the DataStack to allow lightweight migration for the store when added synchronously

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case allowSynchronousLightweightMigration = 4
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Enums/CoreStore.html b/docs/Enums/CoreStore.html new file mode 100644 index 0000000..e79291f --- /dev/null +++ b/docs/Enums/CoreStore.html @@ -0,0 +1,4269 @@ + + + + CoreStore Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CoreStore

+
+
+
public enum CoreStore
+ +
+
+

CoreStore is the main entry point for all other APIs.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + defaultStack + +
    +
    +
    +
    +
    +
    +

    The default DataStack instance to be used. If defaultStack is not set before the first time accessed, a default-configured DataStack will be created.

    +
    +

    See also

    + DataStack + +
    +
    +

    Note

    + Changing the defaultStack is thread safe, but it is recommended to setup DataStacks on a common queue (e.g. the main queue). + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static var defaultStack: DataStack { get set }
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Asynchronously adds a StorageInterface to the defaultStack. Migrations are also initiated by default.

    +
    CoreStore.addStorage(
    +    InMemoryStore(configuration: "Config1"),
    +    completion: { result in
    +        switch result {
    +        case .success(let storage): // ...
    +        case .failure(let error): // ...
    +        }
    +    }
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func addStorage<T>(_ storage: T, completion: @escaping (SetupResult<T>) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the storage

    +
    +
    + + completion + + +
    +

    the closure to be executed on the main queue when the process completes, either due to success or failure. The closure’s SetupResult argument indicates the result. Note that the StorageInterface associated to the SetupResult.success may not always be the same instance as the parameter argument if a previous StorageInterface was already added at the same URL and with the same configuration.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously adds a LocalStorage to the defaultStack. Migrations are also initiated by default.

    +
    let migrationProgress = CoreStore.addStorage(
    +    SQLiteStore(fileName: "core_data.sqlite", configuration: "Config1"),
    +    completion: { result in
    +        switch result {
    +        case .success(let storage): // ...
    +        case .failure(let error): // ...
    +        }
    +    }
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func addStorage<T: LocalStorage>(_ storage: T, completion: @escaping (SetupResult<T>) -> Void) -> Progress?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the local storage

    +
    +
    + + completion + + +
    +

    the closure to be executed on the main queue when the process completes, either due to success or failure. The closure’s SetupResult argument indicates the result. Note that the LocalStorage associated to the SetupResult.success may not always be the same instance as the parameter argument if a previous LocalStorage was already added at the same URL and with the same configuration.

    +
    +
    +
    +
    +

    Return Value

    +

    a Progress instance if a migration has started, or nil if either no migrations are required or if a failure occured.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously adds a CloudStorage to the defaultStack. Migrations are also initiated by default.

    +
    guard let storage = ICloudStore(
    +    ubiquitousContentName: "MyAppCloudData",
    +    ubiquitousContentTransactionLogsSubdirectory: "logs/config1",
    +    ubiquitousContainerID: "iCloud.com.mycompany.myapp.containername",
    +    ubiquitousPeerToken: "9614d658014f4151a95d8048fb717cf0",
    +    configuration: "Config1",
    +    cloudStorageOptions: .recreateLocalStoreOnModelMismatch
    +) else {
    +    // iCloud is not available on the device
    +    return
    +}
    +let migrationProgress = dataStack.addStorage(
    +    storage,
    +    completion: { result in
    +        switch result {
    +        case .success(let storage): // ...
    +        case .failure(let error): // ...
    +        }
    +    }
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func addStorage<T: CloudStorage>(_ storage: T, completion: @escaping (SetupResult<T>) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the cloud storage

    +
    +
    + + completion + + +
    +

    the closure to be executed on the main queue when the process completes, either due to success or failure. The closure’s SetupResult argument indicates the result. Note that the CloudStorage associated to the SetupResult.success may not always be the same instance as the parameter argument if a previous CloudStorage was already added at the same URL and with the same configuration.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Migrates a local storage to match the defaultStack‘s managed object model version. This method does NOT add the migrated store to the data stack.

    +
    +

    Throws

    + a CoreStoreError value indicating the failure + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func upgradeStorageIfNeeded<T: LocalStorage>(_ storage: T, completion: @escaping (MigrationResult) -> Void) throws -> Progress?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the local storage

    +
    +
    + + completion + + +
    +

    the closure to be executed on the main queue when the migration completes, either due to success or failure. The closure’s MigrationResult argument indicates the result. This closure is NOT executed if an error is thrown, but will be executed with a .failure result if an error occurs asynchronously.

    +
    +
    +
    +
    +

    Return Value

    +

    a Progress instance if a migration has started, or nil is no migrations are required

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Checks the migration steps required for the storage to match the defaultStack‘s managed object model version.

    +
    +

    Throws

    + a CoreStoreError value indicating the failure + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func requiredMigrationsForStorage<T>(_ storage: T) throws -> [MigrationType] where T : LocalStorage
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + storage + + +
    +

    the local storage

    +
    +
    +
    +
    +

    Return Value

    +

    a MigrationType array indicating the migration steps required for the store, or an empty array if the file does not exist yet. Otherwise, an error is thrown if either inspection of the store failed, or if no mapping model was found/inferred.

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + monitorObject(_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, creates an ObjectMonitor for the specified DynamicObject. Multiple ObjectObservers may then register themselves to be notified when changes are made to the DynamicObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func monitorObject<D>(_ object: D) -> ObjectMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the DynamicObject to observe changes from

    +
    +
    +
    +
    +

    Return Value

    +

    a ObjectMonitor that monitors changes to object

    +
    +
    +
    +
  • +
  • +
    + + + + monitorList(_:_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, creates a ListMonitor for a list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func monitorList<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> ListMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • +
    + + + + monitorList(_:_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, creates a ListMonitor for a list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func monitorList<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> ListMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • +
    + + + + monitorList(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ListMonitor for a list of DynamicObjects that satisfy the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let monitor = CoreStore.monitorList(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func monitorList<B>(_ clauseChain: B) -> ListMonitor<B.ObjectType> where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor for a list of DynamicObjects that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, asynchronously creates a ListMonitor for a list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func monitorList<D>(createAsynchronously: @escaping (ListMonitor<D>) -> Void, _ from: From<D>, _ fetchClauses: FetchClause...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, asynchronously creates a ListMonitor for a list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func monitorList<D>(createAsynchronously: @escaping (ListMonitor<D>) -> Void, _ from: From<D>, _ fetchClauses: [FetchClause])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a ListMonitor for a list of DynamicObjects that satisfy the specified FetchChainableBuilderType built from a chain of clauses. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    +
    CoreStore.monitorList(
    +    { (monitor) in
    +        self.monitor = monitor
    +    },
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func monitorList<B: FetchChainableBuilderType>(createAsynchronously: @escaping (ListMonitor<B.ObjectType>) -> Void, _ clauseChain: B)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor for a list of DynamicObjects that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func monitorSectionedList<D>(_ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: FetchClause...) -> ListMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func monitorSectionedList<D>(_ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: [FetchClause]) -> ListMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified SectionMonitorBuilderType built from a chain of clauses.

    +
    let monitor = CoreStore.monitorSectionedList(
    +    From<MyPersonEntity>()
    +        .sectionBy(\.age, { "\($0!) years old" })
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func monitorSectionedList<B>(_ clauseChain: B) -> ListMonitor<B.ObjectType> where B : SectionMonitorBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a SectionMonitorBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor for a list of DynamicObjects that satisfy the specified SectionMonitorBuilderType

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, asynchronously creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func monitorSectionedList<D>(createAsynchronously: @escaping (ListMonitor<D>) -> Void, _ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: FetchClause...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, asynchronously creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func monitorSectionedList<D>(createAsynchronously: @escaping (ListMonitor<D>) -> Void, _ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: [FetchClause])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified SectionMonitorBuilderType built from a chain of clauses.

    +
    CoreStore.monitorSectionedList(
    +    { (monitor) in
    +        self.monitor = monitor
    +    },
    +    From<MyPersonEntity>()
    +        .sectionBy(\.age, { "\($0!) years old" })
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func monitorSectionedList<B: SectionMonitorBuilderType>(createAsynchronously: @escaping (ListMonitor<B.ObjectType>) -> Void, _ clauseChain: B)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a SectionMonitorBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor for a list of DynamicObjects that satisfy the specified SectionMonitorBuilderType

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the DynamicObject instance in the DataStack‘s context from a reference created from a transaction or from a different managed object context.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchExisting<D>(_ object: D) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    a reference to the object created/fetched outside the DataStack

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject instance if the object exists in the DataStack, or nil if not found.

    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the DynamicObject instance in the DataStack‘s context from an NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchExisting<D>(_ objectID: NSManagedObjectID) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objectID + + +
    +

    the NSManagedObjectID for the object

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject instance if the object exists in the DataStack, or nil if not found.

    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the DynamicObject instances in the DataStack‘s context from references created from a transaction or from a different managed object context.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchExisting<D, S>(_ objects: S) -> [D] where D : DynamicObject, D == S.Element, S : Sequence
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objects + + +
    +

    an array of DynamicObjects created/fetched outside the DataStack

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject array for objects that exists in the DataStack

    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the DynamicObject instances in the DataStack‘s context from a list of NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchExisting<D, S>(_ objectIDs: S) -> [D] where D : DynamicObject, S : Sequence, S.Element == NSManagedObjectID
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objectIDs + + +
    +

    the NSManagedObjectID array for the objects

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject array for objects that exists in the DataStack

    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the first DynamicObject instance that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the first DynamicObject instance that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the first DynamicObject instance that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the first DynamicObject instance that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the first DynamicObject instance that satisfies the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let youngestTeen = CoreStore.fetchOne(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne<B>(_ clauseChain: B) -> B.ObjectType? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the first DynamicObject instance that satisfies the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches all DynamicObject instances that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> [D]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    all DynamicObject instances that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches all DynamicObject instances that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> [D]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    all DynamicObject instances that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches all DynamicObject instances that satisfy the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let people = CoreStore.fetchAll(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll<B>(_ clauseChain: B) -> [B.ObjectType]? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    all DynamicObject instances that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the number of DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCount<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> Int? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the number DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the number of DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCount<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> Int? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the number DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the number of DynamicObjects that satisfy the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let numberOfAdults = CoreStore.fetchCount(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCount<B>(_ clauseChain: B) -> Int? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the number DynamicObjects that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> NSManagedObjectID? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> NSManagedObjectID? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let youngestTeenID = CoreStore.fetchObjectID(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchObjectID<B>(_ clauseChain: B) -> NSManagedObjectID? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> [NSManagedObjectID]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> [NSManagedObjectID]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let idsOfAdults = transaction.fetchObjectIDs(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchObjectIDs<B>(_ clauseChain: B) -> [NSManagedObjectID]? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + queryValue(_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, queries aggregate values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func queryValue<D, U>(_ from: From<D>, _ selectClause: Select<D, U>, _ queryClauses: QueryClause...) -> U? where D : DynamicObject, U : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • +
    + + + + queryValue(_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, queries aggregate values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func queryValue<D, U>(_ from: From<D>, _ selectClause: Select<D, U>, _ queryClauses: [QueryClause]) -> U? where D : DynamicObject, U : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • +
    + + + + queryValue(_:) + +
    +
    +
    +
    +
    +
    +

    Queries a property value or aggregate as specified by the QueryChainableBuilderType built from a chain of clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    +
    let averageAdultAge = CoreStore.queryValue(
    +    From<MyPersonEntity>()
    +        .select(Int.self, .average(\.age))
    +        .where(\.age > 18)
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func queryValue<B>(_ clauseChain: B) -> B.ResultType? where B : QueryChainableBuilderType, B.ResultType : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a QueryChainableBuilderType indicating the property/aggregate to fetch and the series of queries for the request.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query as specified by the QueryChainableBuilderType

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, queries a dictionary of attribute values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func queryAttributes<D>(_ from: From<D>, _ selectClause: Select<D, NSDictionary>, _ queryClauses: QueryClause...) -> [[String : Any]]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, queries a dictionary of attribute values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func queryAttributes<D>(_ from: From<D>, _ selectClause: Select<D, NSDictionary>, _ queryClauses: [QueryClause]) -> [[String : Any]]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • +
    + + + + queryAttributes(_:) + +
    +
    +
    +
    +
    +
    +

    Queries a dictionary of attribute values or as specified by the QueryChainableBuilderType built from a chain of clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    +
    let results = CoreStore.queryAttributes(
    +    From<MyPersonEntity>()
    +        .select(
    +            NSDictionary.self,
    +            .attribute(\.age, as: "age"),
    +            .count(\.age, as: "numberOfPeople")
    +        )
    +        .groupBy(\.age)
    +)
    +for dictionary in results! {
    +    let age = dictionary["age"] as! Int
    +    let count = dictionary["numberOfPeople"] as! Int
    +    print("There are \(count) people who are \(age) years old."
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func queryAttributes<B>(_ clauseChain: B) -> [[String : Any]]? where B : QueryChainableBuilderType, B.ResultType == NSDictionary
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a QueryChainableBuilderType indicating the properties to fetch and the series of queries for the request.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query as specified by the QueryChainableBuilderType

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + modelVersion + +
    +
    +
    +
    +
    +
    +

    Returns the defaultStack‘s model version. The version string is the same as the name of a version-specific .xcdatamodeld file or CoreStoreSchema.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static var modelVersion: String { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the entity name-to-class type mapping from the defaultStack‘s model.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func entityTypesByName(for type: NSManagedObject.Type) -> [EntityName : NSManagedObject.Type]
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the entity name-to-class type mapping from the defaultStack‘s model.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func entityTypesByName(for type: CoreStoreObject.Type) -> [EntityName : CoreStoreObject.Type]
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the NSEntityDescription for the specified NSManagedObject subclass from defaultStack‘s model.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func entityDescription(for type: NSManagedObject.Type) -> NSEntityDescription?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the NSEntityDescription for the specified CoreStoreObject subclass from defaultStack‘s model.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func entityDescription(for type: CoreStoreObject.Type) -> NSEntityDescription?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + addStorageAndWait() + +
    +
    +
    +
    +
    +
    +

    Creates an SQLiteStore with default parameters and adds it to the defaultStack. This method blocks until completion.

    +
    try CoreStore.addStorageAndWait()
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public static func addStorageAndWait() throws -> SQLiteStore
    + +
    +
    +
    +

    Return Value

    +

    the local SQLite storage added to the defaultStack

    +
    +
    +
    +
  • +
  • +
    + + + + addStorageAndWait(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a StorageInterface to the defaultStack and blocks until completion.

    +
    try CoreStore.addStorageAndWait(InMemoryStore(configuration: "Config1"))
    +
    +
    +

    Throws

    + a CoreStoreError value indicating the failure + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public static func addStorageAndWait<T>(_ storage: T) throws -> T where T : StorageInterface
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + storage + + + +
    +
    +
    +

    Return Value

    +

    the StorageInterface added to the defaultStack

    +
    +
    +
    +
  • +
  • +
    + + + + addStorageAndWait(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a LocalStorage to the defaultStack and blocks until completion.

    +
    try CoreStore.addStorageAndWait(SQLiteStore(configuration: "Config1"))
    +
    +
    +

    Throws

    + a CoreStoreError value indicating the failure + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public static func addStorageAndWait<T>(_ storage: T) throws -> T where T : LocalStorage
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + storage + + +
    +

    the local storage

    +
    +
    +
    +
    +

    Return Value

    +

    the local storage added to the defaultStack. Note that this may not always be the same instance as the parameter argument if a previous LocalStorage was already added at the same URL and with the same configuration.

    +
    +
    +
    +
  • +
  • +
    + + + + addStorageAndWait(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a CloudStorage to the defaultStack and blocks until completion.

    +
    guard let storage = ICloudStore(
    +    ubiquitousContentName: "MyAppCloudData",
    +    ubiquitousContentTransactionLogsSubdirectory: "logs/config1",
    +    ubiquitousContainerID: "iCloud.com.mycompany.myapp.containername",
    +    ubiquitousPeerToken: "9614d658014f4151a95d8048fb717cf0",
    +    configuration: "Config1",
    +    cloudStorageOptions: .recreateLocalStoreOnModelMismatch
    +) else {
    +    // iCloud is not available on the device
    +    return
    +}
    +try CoreStore.addStorageAndWait(storage)
    +
    +
    +

    Throws

    + a CoreStoreError value indicating the failure + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public static func addStorageAndWait<T>(_ storage: T) throws -> T where T : CloudStorage
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + storage + + +
    +

    the local storage

    +
    +
    +
    +
    +

    Return Value

    +

    the cloud storage added to the stack. Note that this may not always be the same instance as the parameter argument if a previous CloudStorage was already added at the same URL and with the same configuration.

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, performs a transaction asynchronously where NSManagedObject or CoreStoreObject creates, updates, and deletes can be made. The changes are commited automatically after the task closure returns. On success, the value returned from closure will be the wrapped as .success(userInfo: T) in the completion‘s Result<T>. Any errors thrown from inside the task will be reported as .failure(error: CoreStoreError). To cancel/rollback changes, call try transaction.cancel(), which throws a CoreStoreError.userCancelled.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func perform<T>(asynchronous task: @escaping (_ transaction: AsynchronousDataTransaction) throws -> T, completion: @escaping (AsynchronousDataTransaction.Result<T>) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + task + + +
    +

    the asynchronous closure where creates, updates, and deletes can be made to the transaction. Transaction blocks are executed serially in a background queue, and all changes are made from a concurrent NSManagedObjectContext.

    +
    +
    + + completion + + +
    +

    the closure executed after the save completes. The Result argument of the closure will either wrap the return value of task, or any uncaught errors thrown from within task. Cancelled tasks will be indicated by .failure(error: CoreStoreError.userCancelled). Custom errors thrown by the user will be wrapped in CoreStoreError.userError(error: Error).

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, performs a transaction asynchronously where NSManagedObject or CoreStoreObject creates, updates, and deletes can be made. The changes are commited automatically after the task closure returns. On success, the value returned from closure will be the argument of the success closure. Any errors thrown from inside the task will be wrapped in a CoreStoreError and reported in the failure closure. To cancel/rollback changes, call try transaction.cancel(), which throws a CoreStoreError.userCancelled.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func perform<T>(asynchronous task: @escaping (_ transaction: AsynchronousDataTransaction) throws -> T, success: @escaping (T) -> Void, failure: @escaping (CoreStoreError) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + task + + +
    +

    the asynchronous closure where creates, updates, and deletes can be made to the transaction. Transaction blocks are executed serially in a background queue, and all changes are made from a concurrent NSManagedObjectContext.

    +
    +
    + + success + + +
    +

    the closure executed after the save succeeds. The T argument of the closure will be the value returned from task.

    +
    +
    + + failure + + +
    +

    the closure executed if the save fails or if any errors are thrown within task. Cancelled tasks will be indicated by CoreStoreError.userCancelled. Custom errors thrown by the user will be wrapped in CoreStoreError.userError(error: Error).

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, performs a transaction synchronously where NSManagedObject or CoreStoreObject creates, updates, and deletes can be made. The changes are commited automatically after the task closure returns. On success, the value returned from closure will be the return value of perform(synchronous:). Any errors thrown from inside the task will be thrown from perform(synchronous:). To cancel/rollback changes, call try transaction.cancel(), which throws a CoreStoreError.userCancelled.

    +
    +

    Throws

    + a CoreStoreError value indicating the failure. Cancelled tasks will be indicated by CoreStoreError.userCancelled. Custom errors thrown by the user will be wrapped in CoreStoreError.userError(error: Error). + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func perform<T>(synchronous task: ((_ transaction: SynchronousDataTransaction) throws -> T), waitForAllObservers: Bool = true) throws -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + task + + +
    +

    the synchronous non-escaping closure where creates, updates, and deletes can be made to the transaction. Transaction blocks are executed serially in a background queue, and all changes are made from a concurrent NSManagedObjectContext.

    +
    +
    + + waitForAllObservers + + +
    +

    When true, this method waits for all observers to be notified of the changes before returning. This results in more predictable data update order, but may risk triggering deadlocks. When false, this method does not wait for observers to be notified of the changes before returning. This results in lower risk for deadlocks, but the updated data may not have been propagated to the DataStack after returning. Defaults to true.

    +
    +
    +
    +
    +

    Return Value

    +

    the value returned from task

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, begins a non-contiguous transaction where NSManagedObject or CoreStoreObject creates, updates, and deletes can be made. This is useful for making temporary changes, such as partially filled forms.

    + +
      +
    • prameter supportsUndo: undo(), redo(), and rollback() methods are only available when this parameter is true, otherwise those method will raise an exception. Defaults to false. Note that turning on Undo support may heavily impact performance especially on iOS or watchOS where memory is limited.
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func beginUnsafe(supportsUndo: Bool = false) -> UnsafeDataTransaction
    + +
    +
    +
    +

    Return Value

    +

    a UnsafeDataTransaction instance where creates, updates, and deletes can be made.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Refreshes all registered objects NSManagedObjects or CoreStoreObjects in the defaultStack.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func refreshAndMergeAllObjects()
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Enums/CoreStoreError.html b/docs/Enums/CoreStoreError.html new file mode 100644 index 0000000..b74e0b8 --- /dev/null +++ b/docs/Enums/CoreStoreError.html @@ -0,0 +1,1278 @@ + + + + CoreStoreError Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CoreStoreError

+
+
+
public enum CoreStoreError : Error, CustomNSError, Hashable
+ +
+
+

All errors thrown from CoreStore are expressed in CoreStoreError enum values.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + unknown + +
    +
    +
    +
    +
    +
    +

    A failure occured because of an unknown error.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case unknown
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The NSPersistentStore could not be initialized because another store existed at the specified NSURL.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case differentStorageExistsAtURL(existingPersistentStoreURL: URL)
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    An NSMappingModel could not be found for a specific source and destination model versions.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case mappingModelNotFound(localStoreURL: URL, targetModel: NSManagedObjectModel, targetModelVersion: String)
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Progressive migrations are disabled for a store, but an NSMappingModel could not be found for a specific source and destination model versions.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case progressiveMigrationRequired(localStoreURL: URL)
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The LocalStorage was configured with .allowSynchronousLightweightMigration, but the model can only be migrated asynchronously.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case asynchronousMigrationRequired(localStoreURL: URL, NSError: NSError)
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    An internal SDK call failed with the specified NSError.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case internalError(NSError: NSError)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + userError(error:) + +
    +
    +
    +
    +
    +
    +

    The transaction was terminated by a user-thrown Error.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case userError(error: Error)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + userCancelled + +
    +
    +
    +
    +
    +
    +

    The transaction was cancelled by the user.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case userCancelled
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + errorDomain + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static var errorDomain: String { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + errorCode + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var errorCode: Int { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + errorUserInfo + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var errorUserInfo: [String : Any] { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: CoreStoreError, rhs: CoreStoreError) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + bridgeToObjectiveC + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var bridgeToObjectiveC: CSError { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init?(_bridgedNSError error: NSError)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Enums/CoreStoreErrorCode.html b/docs/Enums/CoreStoreErrorCode.html new file mode 100644 index 0000000..f3988d1 --- /dev/null +++ b/docs/Enums/CoreStoreErrorCode.html @@ -0,0 +1,1004 @@ + + + + CoreStoreErrorCode Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CoreStoreErrorCode

+
+
+
public enum CoreStoreErrorCode : Int
+ +
+
+

The NSError error codes for CoreStoreErrorDomain.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + unknownError + +
    +
    +
    +
    +
    +
    +

    A failure occured because of an unknown error.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case unknownError
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The NSPersistentStore could note be initialized because another store existed at the specified NSURL.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case differentStorageExistsAtURL
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + mappingModelNotFound + +
    +
    +
    +
    +
    +
    +

    An NSMappingModel could not be found for a specific source and destination model versions.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case mappingModelNotFound
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Progressive migrations are disabled for a store, but an NSMappingModel could not be found for a specific source and destination model versions.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case progressiveMigrationRequired
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The LocalStorage was configured with .allowSynchronousLightweightMigration, but the model can only be migrated asynchronously.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case asynchronousMigrationRequired
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + internalError + +
    +
    +
    +
    +
    +
    +

    An internal SDK call failed with the specified NSError userInfo key.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case internalError
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + userError + +
    +
    +
    +
    +
    +
    +

    The transaction was terminated by a user-thrown Error specified by Error userInfo key.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case userError
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + userCancelled + +
    +
    +
    +
    +
    +
    +

    The transaction was cancelled by the user.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case userCancelled
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Enums/MigrationResult.html b/docs/Enums/MigrationResult.html new file mode 100644 index 0000000..9840ad3 --- /dev/null +++ b/docs/Enums/MigrationResult.html @@ -0,0 +1,953 @@ + + + + MigrationResult Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

MigrationResult

+
+
+
public enum MigrationResult : Hashable
+ +
+
+

The MigrationResult indicates the result of a migration. +The MigrationResult can be treated as a boolean:

+
CoreStore.upgradeStorageIfNeeded(SQLiteStorage(fileName: "data.sqlite")) { (result) in
+    switch result {
+    case .success(let migrationSteps):
+        // ...
+    case .failure(let error):
+        // ...
+    }
+}
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + success(_:) + +
    +
    +
    +
    +
    +
    +

    MigrationResult.success indicates either the migration succeeded, or there were no migrations needed. The associated value is an array of MigrationTypes reflecting the migration steps completed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case success([MigrationType])
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + failure(_:) + +
    +
    +
    +
    +
    +
    +

    SaveResult.failure indicates that the migration failed. The associated object for this value is the a CoreStoreError enum value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case failure(CoreStoreError)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + isSuccess + +
    +
    +
    +
    +
    +
    +

    Returns true if the result indicates .success, false if the result is .failure.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isSuccess: Bool { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Enums/MigrationType.html b/docs/Enums/MigrationType.html new file mode 100644 index 0000000..562ea1a --- /dev/null +++ b/docs/Enums/MigrationType.html @@ -0,0 +1,1152 @@ + + + + MigrationType Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

MigrationType

+
+
+
public enum MigrationType : Hashable
+ +
+
+

The MigrationType specifies the type of migration required for a store.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + none(version:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the persistent store matches the latest model version and no migration is needed

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case none(version: ModelVersion)
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Indicates that the persistent store does not match the latest model version but Core Data can infer the mapping model, so a lightweight migration is needed

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case lightweight(sourceVersion: ModelVersion, destinationVersion: ModelVersion)
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Indicates that the persistent store does not match the latest model version and Core Data could not infer a mapping model, so a custom migration is needed

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case heavyweight(sourceVersion: ModelVersion, destinationVersion: ModelVersion)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + sourceVersion + +
    +
    +
    +
    +
    +
    +

    Returns the source model version for the migration type. If no migration is required, sourceVersion will be equal to the destinationVersion.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var sourceVersion: ModelVersion { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + destinationVersion + +
    +
    +
    +
    +
    +
    +

    Returns the destination model version for the migration type. If no migration is required, destinationVersion will be equal to the sourceVersion.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var destinationVersion: ModelVersion { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns true if the MigrationType is a lightweight migration. Used as syntactic sugar.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isLightweightMigration: Bool { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns true if the MigrationType is a heavyweight migration. Used as syntactic sugar.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isHeavyweightMigration: Bool { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + hasMigration + +
    +
    +
    +
    +
    +
    +

    Returns true if the MigrationType is either a lightweight or a heavyweight migration. Returns false if no migrations specified.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var hasMigration: Bool { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: MigrationType, rhs: MigrationType) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Enums/RelationshipContainer.html b/docs/Enums/RelationshipContainer.html new file mode 100644 index 0000000..8483587 --- /dev/null +++ b/docs/Enums/RelationshipContainer.html @@ -0,0 +1,944 @@ + + + + RelationshipContainer Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

RelationshipContainer

+
+
+
public enum RelationshipContainer<O> where O : CoreStoreObject
+ +
+
+

The containing type for relationships. Use the DynamicObject.Relationship typealias instead for shorter syntax.

+
class Dog: CoreStoreObject {
+    let master = Relationship.ToOne<Person>("master")
+}
+class Person: CoreStoreObject {
+    let pets = Relationship.ToManyUnordered<Dog>("pets", inverse: { $0.master })
+}
+
+ +
+
+ +
+
+
+
+ + + +

ToOne

+
+
+
    +
  • +
    + + + + ToOne + +
    +
    +
    +
    +
    +
    +

    The containing type for to-one relationships. Any CoreStoreObject subclass can be a destination type. Inverse relationships should be declared from the destination type as well, using the inverse: argument for the relationship.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyUnordered<Dog>("pets", inverse: { $0.master })
    +}
    +
    +
    +

    Important

    + Relationship.ToOne properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class ToOne<D> : RelationshipProtocol where D : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ToManyOrdered + +
    +
    +
    +
    +
    +
    +

    The containing type for to-many ordered relationships. Any CoreStoreObject subclass can be a destination type. Inverse relationships should be declared from the destination type as well, using the inverse: argument for the relationship.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyOrdered<Dog>("pets", inverse: { $0.master })
    +}
    +
    +
    +

    Important

    + Relationship.ToManyOrdered properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class ToManyOrdered<D> : RelationshipProtocol where D : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ToManyUnordered + +
    +
    +
    +
    +
    +
    +

    The containing type for to-many unordered relationships. Any CoreStoreObject subclass can be a destination type. Inverse relationships should be declared from the destination type as well, using the inverse: argument for the relationship.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyUnordered<Dog>("pets", inverse: { $0.master })
    +}
    +
    +
    +

    Important

    + Relationship.ToManyUnordered properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class ToManyUnordered<D> : RelationshipProtocol where D : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Enums/RelationshipContainer/ToManyOrdered.html b/docs/Enums/RelationshipContainer/ToManyOrdered.html new file mode 100644 index 0000000..1cd1cf1 --- /dev/null +++ b/docs/Enums/RelationshipContainer/ToManyOrdered.html @@ -0,0 +1,1920 @@ + + + + ToManyOrdered Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ToManyOrdered

+
+
+
public final class ToManyOrdered<D> : RelationshipProtocol where D : CoreStoreObject
+ +
+
+

The containing type for to-many ordered relationships. Any CoreStoreObject subclass can be a destination type. Inverse relationships should be declared from the destination type as well, using the inverse: argument for the relationship.

+
class Dog: CoreStoreObject {
+    let master = Relationship.ToOne<Person>("master")
+}
+class Person: CoreStoreObject {
+    let pets = Relationship.ToManyOrdered<Dog>("pets", inverse: { $0.master })
+}
+
+
+

Important

+ Relationship.ToManyOrdered properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the relationship. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object. Make sure to declare this relationship’s inverse relationship on its destination object. Due to Swift’s compiler limitation, only one of the relationship and its inverse can declare an inverse: argument.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyOrdered<Dog>("pets", inverse: { $0.master })
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(
    +    _ keyPath: KeyPathString,
    +    minCount: Int = 0,
    +    maxCount: Int = 0,
    +    deleteRule: DeleteRule = .nullify,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent name for this relationship.

    +
    +
    + + minCount + + +
    +

    the minimum number of objects in this relationship UNLESS THE RELATIONSHIP IS EMPTY. This means there might be zero objects in the relationship, which might be less than minCount. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + maxCount + + +
    +

    the maximum number of objects in this relationship. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + deleteRule + + +
    +

    defines what happens to relationship when an object is deleted. Valid values are .nullify, .cascade, and .delete. Defaults to .nullify.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a relationship as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the relationship. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object. Make sure to declare this relationship’s inverse relationship on its destination object. Due to Swift’s compiler limitation, only one of the relationship and its inverse can declare an inverse: argument.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyOrdered<Dog>("pets", inverse: { $0.master })
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(
    +    _ keyPath: KeyPathString,
    +    minCount: Int = 0,
    +    maxCount: Int = 0,
    +    inverse: @escaping (D) -> RelationshipContainer<D>.ToOne<O>,
    +    deleteRule: DeleteRule = .nullify,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent name for this relationship.

    +
    +
    + + minCount + + +
    +

    the minimum number of objects in this relationship UNLESS THE RELATIONSHIP IS EMPTY. This means there might be zero objects in the relationship, which might be less than minCount. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + maxCount + + +
    +

    the maximum number of objects in this relationship. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + inverse + + +
    +

    the inverse relationship that is declared for the destination object. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object.

    +
    +
    + + deleteRule + + +
    +

    defines what happens to relationship when an object is deleted. Valid values are .nullify, .cascade, and .delete. Defaults to .nullify.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a relationship as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the relationship. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object. Make sure to declare this relationship’s inverse relationship on its destination object. Due to Swift’s compiler limitation, only one of the relationship and its inverse can declare an inverse: argument.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyOrdered<Dog>("pets", inverse: { $0.master })
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(
    +    _ keyPath: KeyPathString,
    +    minCount: Int = 0,
    +    maxCount: Int = 0,
    +    inverse: @escaping (D) -> RelationshipContainer<D>.ToManyOrdered<O>,
    +    deleteRule: DeleteRule = .nullify,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent name for this relationship.

    +
    +
    + + minCount + + +
    +

    the minimum number of objects in this relationship UNLESS THE RELATIONSHIP IS EMPTY. This means there might be zero objects in the relationship, which might be less than minCount. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + maxCount + + +
    +

    the maximum number of objects in this relationship. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + inverse + + +
    +

    the inverse relationship that is declared for the destination object. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object.

    +
    +
    + + deleteRule + + +
    +

    defines what happens to relationship when an object is deleted. Valid values are .nullify, .cascade, and .delete. Defaults to .nullify.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a relationship as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the relationship. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object. Make sure to declare this relationship’s inverse relationship on its destination object. Due to Swift’s compiler limitation, only one of the relationship and its inverse can declare an inverse: argument.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyOrdered<Dog>("pets", inverse: { $0.master })
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(
    +    _ keyPath: KeyPathString,
    +    minCount: Int = 0,
    +    maxCount: Int = 0,
    +    inverse: @escaping (D) -> RelationshipContainer<D>.ToManyUnordered<O>,
    +    deleteRule: DeleteRule = .nullify,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent name for this relationship.

    +
    +
    + + minCount + + +
    +

    the minimum number of objects in this relationship UNLESS THE RELATIONSHIP IS EMPTY. This means there might be zero objects in the relationship, which might be less than minCount. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + maxCount + + +
    +

    the maximum number of objects in this relationship. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + inverse + + +
    +

    the inverse relationship that is declared for the destination object. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object.

    +
    +
    + + deleteRule + + +
    +

    defines what happens to relationship when an object is deleted. Valid values are .nullify, .cascade, and .delete. Defaults to .nullify.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a relationship as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + value + +
    +
    +
    +
    +
    +
    +

    The relationship ordered objects.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var value: [D] { get set }
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = O
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ValueType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ValueType = D
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_keyPathString + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var cs_keyPathString: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + Iterator + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Iterator = AnyIterator<D>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + makeIterator() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func makeIterator() -> Iterator
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + Index + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Index = Int
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + startIndex + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var startIndex: Index { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + endIndex + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var endIndex: Index { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(position: Index) -> Iterator.Element { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + index(after:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func index(after i: Index) -> Index
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns a sequence of objects to the relationship. The operation

    +
    person.pets .= [dog, cat]
    +
    + +

    is equivalent to

    +
    person.pets.value = [dog, cat]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= <S>(relationship: RelationshipContainer<O>.ToManyOrdered<D>, newValue: S) where D == S.Element, S : Sequence
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns a sequence of objects to the relationship. The operation

    +
    person.pets .= anotherPerson.pets
    +
    + +

    is equivalent to

    +
    person.pets.value = anotherPerson.pets.value
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= <O2>(relationship: RelationshipContainer<O>.ToManyOrdered<D>, relationship2: RelationshipContainer<O2>.ToManyOrdered<D>) where O2 : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares equality between a relationship’s objects and a collection of objects

    +
    if person.pets .== [dog, cat] { ... }
    +
    + +

    is equivalent to

    +
    if person.pets.value == [dog, cat] { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== <C>(relationship: RelationshipContainer<O>.ToManyOrdered<D>, collection: C) -> Bool where D == C.Element, C : Collection
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares equality between a collection of objects and a relationship’s objects

    +
    if [dog, cat] .== person.pets { ... }
    +
    + +

    is equivalent to

    +
    if [dog, cat] == person.pets.value { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== <C>(collection: C, relationship: RelationshipContainer<O>.ToManyOrdered<D>) -> Bool where D == C.Element, C : Collection
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares equality between a relationship’s objects and a collection of objects

    +
    if person.pets .== anotherPerson.pets { ... }
    +
    + +

    is equivalent to

    +
    if person.pets.value == anotherPerson.pets.value { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== <O2>(relationship: RelationshipContainer<O>.ToManyOrdered<D>, relationship2: RelationshipContainer<O2>.ToManyOrdered<D>) -> Bool where O2 : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Enums/RelationshipContainer/ToManyUnordered.html b/docs/Enums/RelationshipContainer/ToManyUnordered.html new file mode 100644 index 0000000..6461fcf --- /dev/null +++ b/docs/Enums/RelationshipContainer/ToManyUnordered.html @@ -0,0 +1,1889 @@ + + + + ToManyUnordered Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ToManyUnordered

+
+
+
public final class ToManyUnordered<D> : RelationshipProtocol where D : CoreStoreObject
+ +
+
+

The containing type for to-many unordered relationships. Any CoreStoreObject subclass can be a destination type. Inverse relationships should be declared from the destination type as well, using the inverse: argument for the relationship.

+
class Dog: CoreStoreObject {
+    let master = Relationship.ToOne<Person>("master")
+}
+class Person: CoreStoreObject {
+    let pets = Relationship.ToManyUnordered<Dog>("pets", inverse: { $0.master })
+}
+
+
+

Important

+ Relationship.ToManyUnordered properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the relationship. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object. Make sure to declare this relationship’s inverse relationship on its destination object. Due to Swift’s compiler limitation, only one of the relationship and its inverse can declare an inverse: argument.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyOrdered<Dog>("pets", inverse: { $0.master })
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(
    +    _ keyPath: KeyPathString,
    +    deleteRule: DeleteRule = .nullify,
    +    minCount: Int = 0,
    +    maxCount: Int = 0,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent name for this relationship.

    +
    +
    + + minCount + + +
    +

    the minimum number of objects in this relationship UNLESS THE RELATIONSHIP IS EMPTY. This means there might be zero objects in the relationship, which might be less than minCount. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + maxCount + + +
    +

    the maximum number of objects in this relationship. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + inverse + + +
    +

    the inverse relationship that is declared for the destination object. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object.

    +
    +
    + + deleteRule + + +
    +

    defines what happens to relationship when an object is deleted. Valid values are .nullify, .cascade, and .delete. Defaults to .nullify.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a relationship as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the relationship. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object. Make sure to declare this relationship’s inverse relationship on its destination object. Due to Swift’s compiler limitation, only one of the relationship and its inverse can declare an inverse: argument.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyOrdered<Dog>("pets", inverse: { $0.master })
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(
    +    _ keyPath: KeyPathString,
    +    inverse: @escaping (D) -> RelationshipContainer<D>.ToOne<O>,
    +    deleteRule: DeleteRule = .nullify,
    +    minCount: Int = 0,
    +    maxCount: Int = 0,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent name for this relationship.

    +
    +
    + + minCount + + +
    +

    the minimum number of objects in this relationship UNLESS THE RELATIONSHIP IS EMPTY. This means there might be zero objects in the relationship, which might be less than minCount. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + maxCount + + +
    +

    the maximum number of objects in this relationship. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + inverse + + +
    +

    the inverse relationship that is declared for the destination object. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object.

    +
    +
    + + deleteRule + + +
    +

    defines what happens to relationship when an object is deleted. Valid values are .nullify, .cascade, and .delete. Defaults to .nullify.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a relationship as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the relationship. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object. Make sure to declare this relationship’s inverse relationship on its destination object. Due to Swift’s compiler limitation, only one of the relationship and its inverse can declare an inverse: argument.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyOrdered<Dog>("pets", inverse: { $0.master })
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(
    +    _ keyPath: KeyPathString,
    +    inverse: @escaping (D) -> RelationshipContainer<D>.ToManyOrdered<O>,
    +    deleteRule: DeleteRule = .nullify,
    +    minCount: Int = 0,
    +    maxCount: Int = 0,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent name for this relationship.

    +
    +
    + + minCount + + +
    +

    the minimum number of objects in this relationship UNLESS THE RELATIONSHIP IS EMPTY. This means there might be zero objects in the relationship, which might be less than minCount. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + maxCount + + +
    +

    the maximum number of objects in this relationship. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + inverse + + +
    +

    the inverse relationship that is declared for the destination object. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object.

    +
    +
    + + deleteRule + + +
    +

    defines what happens to relationship when an object is deleted. Valid values are .nullify, .cascade, and .delete. Defaults to .nullify.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a relationship as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the relationship. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object. Make sure to declare this relationship’s inverse relationship on its destination object. Due to Swift’s compiler limitation, only one of the relationship and its inverse can declare an inverse: argument.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyOrdered<Dog>("pets", inverse: { $0.master })
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(
    +    _ keyPath: KeyPathString,
    +    inverse: @escaping (D) -> RelationshipContainer<D>.ToManyUnordered<O>,
    +    deleteRule: DeleteRule = .nullify,
    +    minCount: Int = 0,
    +    maxCount: Int = 0,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent name for this relationship.

    +
    +
    + + minCount + + +
    +

    the minimum number of objects in this relationship UNLESS THE RELATIONSHIP IS EMPTY. This means there might be zero objects in the relationship, which might be less than minCount. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + maxCount + + +
    +

    the maximum number of objects in this relationship. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + inverse + + +
    +

    the inverse relationship that is declared for the destination object. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object.

    +
    +
    + + deleteRule + + +
    +

    defines what happens to relationship when an object is deleted. Valid values are .nullify, .cascade, and .delete. Defaults to .nullify.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a relationship as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + value + +
    +
    +
    +
    +
    +
    +

    The relationship unordered objects.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var value: Set<D> { get set }
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = O
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ValueType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ValueType = D
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_keyPathString + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var cs_keyPathString: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + count + +
    +
    +
    +
    +
    +
    +

    The number of elements in the set.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var count: Int { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + isEmpty + +
    +
    +
    +
    +
    +
    +

    A Boolean value indicating whether the range contains no elements.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isEmpty: Bool { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + Iterator + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Iterator = AnyIterator<D>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + makeIterator() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func makeIterator() -> Iterator
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns a sequence of objects to the relationship. The operation

    +
    person.pets .= [dog, cat]
    +
    + +

    is equivalent to

    +
    person.pets.value = [dog, cat]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= <S>(relationship: RelationshipContainer<O>.ToManyUnordered<D>, newValue: S) where D == S.Element, S : Sequence
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns a sequence of objects to the relationship. The operation

    +
    person.pets .= anotherPerson.pets
    +
    + +

    is equivalent to

    +
    person.pets.value = anotherPerson.pets.value
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= <O2>(relationship: RelationshipContainer<O>.ToManyUnordered<D>, relationship2: RelationshipContainer<O2>.ToManyUnordered<D>) where O2 : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns a sequence of objects to the relationship. The operation

    +
    person.pets .= anotherPerson.pets
    +
    + +

    is equivalent to

    +
    person.pets.value = anotherPerson.pets.value
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= <O2>(relationship: RelationshipContainer<O>.ToManyUnordered<D>, relationship2: RelationshipContainer<O2>.ToManyOrdered<D>) where O2 : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares the if the relationship’s objects and a set of objects have the same elements.

    +
    if person.pets .== Set<Animal>([dog, cat]) { ... }
    +
    + +

    is equivalent to

    +
    if person.pets.value == Set<Animal>([dog, cat]) { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== (relationship: RelationshipContainer<O>.ToManyUnordered<D>, set: Set<D>) -> Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares if a set of objects and a relationship’s objects have the same elements.

    +
    if Set<Animal>([dog, cat]) .== person.pets { ... }
    +
    + +

    is equivalent to

    +
    if Set<Animal>([dog, cat]) == person.pets.value { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== (set: Set<D>, relationship: RelationshipContainer<O>.ToManyUnordered<D>) -> Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares if a relationship’s objects and another relationship’s objects have the same elements.

    +
    if person.pets .== anotherPerson.pets { ... }
    +
    + +

    is equivalent to

    +
    if person.pets.value == anotherPerson.pets.value { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== <O2>(relationship: RelationshipContainer<O>.ToManyUnordered<D>, relationship2: RelationshipContainer<O2>.ToManyUnordered<D>) -> Bool where O2 : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Enums/RelationshipContainer/ToOne.html b/docs/Enums/RelationshipContainer/ToOne.html new file mode 100644 index 0000000..8a4ff82 --- /dev/null +++ b/docs/Enums/RelationshipContainer/ToOne.html @@ -0,0 +1,1710 @@ + + + + ToOne Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ToOne

+
+
+
public final class ToOne<D> : RelationshipProtocol where D : CoreStoreObject
+ +
+
+

The containing type for to-one relationships. Any CoreStoreObject subclass can be a destination type. Inverse relationships should be declared from the destination type as well, using the inverse: argument for the relationship.

+
class Dog: CoreStoreObject {
+    let master = Relationship.ToOne<Person>("master")
+}
+class Person: CoreStoreObject {
+    let pets = Relationship.ToManyUnordered<Dog>("pets", inverse: { $0.master })
+}
+
+
+

Important

+ Relationship.ToOne properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the relationship. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object. Make sure to declare this relationship’s inverse relationship on its destination object. Due to Swift’s compiler limitation, only one of the relationship and its inverse can declare an inverse: argument.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyUnordered<Dog>("pets", inverse: { $0.master })
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(
    +    _ keyPath: KeyPathString,
    +    deleteRule: DeleteRule = .nullify,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent name for this relationship.

    +
    +
    + + deleteRule + + +
    +

    defines what happens to relationship when an object is deleted. Valid values are .nullify, .cascade, and .delete. Defaults to .nullify.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a relationship as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the relationship. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object. Make sure to declare this relationship’s inverse relationship on its destination object. Due to Swift’s compiler limitation, only one of the relationship and its inverse can declare an inverse: argument.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyUnordered<Dog>("pets", inverse: { $0.master })
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(
    +    _ keyPath: KeyPathString,
    +    inverse: @escaping (D) -> RelationshipContainer<D>.ToOne<O>,
    +    deleteRule: DeleteRule = .nullify,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent name for this relationship.

    +
    +
    + + inverse + + +
    +

    the inverse relationship that is declared for the destination object. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object.

    +
    +
    + + deleteRule + + +
    +

    defines what happens to relationship when an object is deleted. Valid values are .nullify, .cascade, and .delete. Defaults to .nullify.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a relationship as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the relationship. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object. Make sure to declare this relationship’s inverse relationship on its destination object. Due to Swift’s compiler limitation, only one of the relationship and its inverse can declare an inverse: argument.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyUnordered<Dog>("pets", inverse: { $0.master })
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(
    +    _ keyPath: KeyPathString,
    +    inverse: @escaping (D) -> RelationshipContainer<D>.ToManyOrdered<O>,
    +    deleteRule: DeleteRule = .nullify,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent name for this relationship.

    +
    +
    + + inverse + + +
    +

    the inverse relationship that is declared for the destination object. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object.

    +
    +
    + + deleteRule + + +
    +

    defines what happens to relationship when an object is deleted. Valid values are .nullify, .cascade, and .delete. Defaults to .nullify.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a relationship as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the relationship. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object. Make sure to declare this relationship’s inverse relationship on its destination object. Due to Swift’s compiler limitation, only one of the relationship and its inverse can declare an inverse: argument.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyUnordered<Dog>("pets", inverse: { $0.master })
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(
    +    _ keyPath: KeyPathString,
    +    inverse: @escaping (D) -> RelationshipContainer<D>.ToManyUnordered<O>,
    +    deleteRule: DeleteRule = .nullify,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent name for this relationship.

    +
    +
    + + inverse + + +
    +

    the inverse relationship that is declared for the destination object. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object.

    +
    +
    + + deleteRule + + +
    +

    defines what happens to relationship when an object is deleted. Valid values are .nullify, .cascade, and .delete. Defaults to .nullify.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a relationship as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + value + +
    +
    +
    +
    +
    +
    +

    The relationship destination object.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var value: D? { get set }
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is equal to a value

    +
    let dog = CoreStore.fetchOne(From<Dog>().where({ $0.master == me }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (relationship: RelationshipContainer<O>.ToOne<D>, object: D?) -> Where<O>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is not equal to a value

    +
    let dog = CoreStore.fetchOne(From<Dog>().where({ $0.master != me }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func != (relationship: RelationshipContainer<O>.ToOne<D>, object: D?) -> Where<O>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ~=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by checking if a sequence contains the value of a property

    +
    let dog = CoreStore.fetchOne(From<Dog>().where({ [john, joe, bob] ~= $0.master }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ~= <S>(sequence: S, relationship: RelationshipContainer<O>.ToOne<D>) -> Where<O> where D == S.Element, S : Sequence
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = O
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ValueType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ValueType = D
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_keyPathString + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var cs_keyPathString: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns an object to the relationship. The operation

    +
    dog.master .= person
    +
    + +

    is equivalent to

    +
    dog.master.value = person
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= (relationship: RelationshipContainer<O>.ToOne<D>, newObject: D?)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns an object from another relationship. The operation

    +
    dog.master .= anotherDog.master
    +
    + +

    is equivalent to

    +
    dog.master.value = anotherDog.master.value
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= <O2>(relationship: RelationshipContainer<O>.ToOne<D>, relationship2: RelationshipContainer<O2>.ToOne<D>) where O2 : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares equality between a relationship’s object and another object

    +
    if dog.master .== person { ... }
    +
    + +

    is equivalent to

    +
    if dog.master.value == person { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== (relationship: RelationshipContainer<O>.ToOne<D>, object: D?) -> Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares equality between an object and a relationship’s object

    +
    if dog.master .== person { ... }
    +
    + +

    is equivalent to

    +
    if dog.master.value == person { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== (object: D?, relationship: RelationshipContainer<O>.ToOne<D>) -> Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares equality between a relationship’s object and another relationship’s object

    +
    if dog.master .== person { ... }
    +
    + +

    is equivalent to

    +
    if dog.master.value == person { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== <O2>(relationship: RelationshipContainer<O>.ToOne<D>, relationship2: RelationshipContainer<O2>.ToOne<D>) -> Bool where O2 : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Enums/SelectTerm.html b/docs/Enums/SelectTerm.html new file mode 100644 index 0000000..f666536 --- /dev/null +++ b/docs/Enums/SelectTerm.html @@ -0,0 +1,3285 @@ + + + + SelectTerm Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SelectTerm

+
+
+
public enum SelectTerm<D> : ExpressibleByStringLiteral, Hashable where D : DynamicObject
+ +
+
+

The SelectTerm is passed to the Select clause to indicate the attributes/aggregate keys to be queried.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + attribute(_:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying an entity attribute. A shorter way to do the same is to assign from the string keypath directly:

    +
    let fullName = CoreStore.queryValue(
    +    From<MyPersonEntity>(),
    +    Select<String>(.attribute("fullName")),
    +    Where("employeeID", isEqualTo: 1111)
    +)
    +
    + +

    is equivalent to:

    +
    let fullName = CoreStore.queryValue(
    +    From<MyPersonEntity>(),
    +    Select<String>("fullName"),
    +    Where("employeeID", isEqualTo: 1111)
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func attribute(_ keyPath: KeyPathString) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying an entity attribute

    +
    +
    +
    +
  • +
  • +
    + + + + average(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the average value of an attribute.

    +
    let averageAge = CoreStore.queryValue(
    +    From<MyPersonEntity>(),
    +    Select<Int>(.average("age"))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func average(_ keyPath: KeyPathString, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key average() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the average value of an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + count(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for a count query.

    +
    let numberOfEmployees = CoreStore.queryValue(
    +    From<MyPersonEntity>(),
    +    Select<Int>(.count("employeeID"))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func count(_ keyPath: KeyPathString, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key count() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for a count query

    +
    +
    +
    +
  • +
  • +
    + + + + maximum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the maximum value for an attribute.

    +
    let maximumAge = CoreStore.queryValue(
    +    From<MyPersonEntity>(),
    +    Select<Int>(.maximum("age"))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func maximum(_ keyPath: KeyPathString, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key max() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the maximum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + minimum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the minimum value for an attribute.

    +
    let minimumAge = CoreStore.queryValue(
    +    From<MyPersonEntity>(),
    +    Select<Int>(.minimum("age"))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func minimum(_ keyPath: KeyPathString, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key min() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the minimum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + sum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the sum value for an attribute.

    +
    let totalAge = CoreStore.queryValue(
    +    From<MyPersonEntity>(),
    +    Select<Int>(.sum("age"))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func sum(_ keyPath: KeyPathString, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key sum() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the sum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + objectID(as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the NSManagedObjectID.

    +
    let objectID = CoreStore.queryValue(
    +    From<MyPersonEntity>(),
    +    Select<NSManagedObjectID>(),
    +    Where("employeeID", isEqualTo: 1111)
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func objectID(as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key objecID is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the sum value for an attribute

    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: SelectTerm<D>, rhs: SelectTerm<D>) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + attribute(_:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying an entity attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func attribute<V>(_ keyPath: KeyPath<D, V>) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying an entity attribute

    +
    +
    +
    +
  • +
  • +
    + + + + average(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the average value of an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func average<V>(_ keyPath: KeyPath<D, V>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key average() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the average value of an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + count(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for a count query.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func count<V>(_ keyPath: KeyPath<D, V>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key count() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for a count query

    +
    +
    +
    +
  • +
  • +
    + + + + maximum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the maximum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func maximum<V>(_ keyPath: KeyPath<D, V>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key max() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the maximum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + minimum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the minimum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func minimum<V>(_ keyPath: KeyPath<D, V>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key min() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the minimum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + sum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the sum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func sum<V>(_ keyPath: KeyPath<D, V>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key sum() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the sum value for an attribute

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + attribute(_:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying an entity attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func attribute<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Required<V>>) -> SelectTerm<D> where V : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying an entity attribute

    +
    +
    +
    +
  • +
  • +
    + + + + attribute(_:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying an entity attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func attribute<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<V>>) -> SelectTerm<D> where V : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying an entity attribute

    +
    +
    +
    +
  • +
  • +
    + + + + attribute(_:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying an entity attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func attribute<V>(_ keyPath: KeyPath<D, TransformableContainer<D>.Required<V>>) -> SelectTerm<D> where V : NSCoding, V : NSCopying
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying an entity attribute

    +
    +
    +
    +
  • +
  • +
    + + + + attribute(_:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying an entity attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func attribute<V>(_ keyPath: KeyPath<D, TransformableContainer<D>.Optional<V>>) -> SelectTerm<D> where V : NSCoding, V : NSCopying
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying an entity attribute

    +
    +
    +
    +
  • +
  • +
    + + + + average(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the average value of an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func average<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key average() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the average value of an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + average(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the average value of an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func average<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key average() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the average value of an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + average(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the average value of an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func average<V>(_ keyPath: KeyPath<D, TransformableContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key average() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the average value of an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + average(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the average value of an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func average<V>(_ keyPath: KeyPath<D, TransformableContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key average() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the average value of an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + count(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for a count query.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func count<V>(_ keyPath: KeyPath<D,
    +    ValueContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key count() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for a count query

    +
    +
    +
    +
  • +
  • +
    + + + + count(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for a count query.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func count<V>(_ keyPath: KeyPath<D,
    +    ValueContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key count() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for a count query

    +
    +
    +
    +
  • +
  • +
    + + + + count(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for a count query.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func count<V>(_ keyPath: KeyPath<D,
    +    TransformableContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key count() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for a count query

    +
    +
    +
    +
  • +
  • +
    + + + + count(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for a count query.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func count<V>(_ keyPath: KeyPath<D,
    +    TransformableContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key count() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for a count query

    +
    +
    +
    +
  • +
  • +
    + + + + maximum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the maximum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func maximum<V>(_ keyPath: KeyPath<D,
    +    ValueContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key max() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the maximum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + maximum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the maximum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func maximum<V>(_ keyPath: KeyPath<D,
    +    ValueContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key max() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the maximum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + maximum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the maximum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func maximum<V>(_ keyPath: KeyPath<D,
    +    TransformableContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key max() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the maximum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + maximum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the maximum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func maximum<V>(_ keyPath: KeyPath<D,
    +    TransformableContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key max() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the maximum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + minimum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the minimum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func minimum<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key min() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the minimum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + minimum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the minimum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func minimum<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key min() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the minimum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + minimum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the minimum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func minimum<V>(_ keyPath: KeyPath<D, TransformableContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key min() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the minimum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + minimum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the minimum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func minimum<V>(_ keyPath: KeyPath<D, TransformableContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key min() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the minimum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + sum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the sum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func sum<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key sum() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the sum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + sum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the sum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func sum<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key sum() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the sum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + sum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the sum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func sum<V>(_ keyPath: KeyPath<D, TransformableContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key sum() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the sum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + sum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the sum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func sum<V>(_ keyPath: KeyPath<D, TransformableContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key sum() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the sum value for an attribute

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Enums/SetupResult.html b/docs/Enums/SetupResult.html new file mode 100644 index 0000000..aa66631 --- /dev/null +++ b/docs/Enums/SetupResult.html @@ -0,0 +1,1007 @@ + + + + SetupResult Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SetupResult

+
+
+
public enum SetupResult<T> : Hashable where T : StorageInterface
+ +
+
+

The SetupResult indicates the result of an asynchronous initialization of a persistent store. +The SetupResult can be treated as a boolean:

+
try! CoreStore.addStorage(
+    SQLiteStore(),
+    completion: { (result: SetupResult) -> Void in
+        if result {
+            // succeeded
+        }
+        else {
+            // failed
+        }
+    }
+)
+
+ +

or as an enum, where the resulting associated object can also be inspected:

+
try! CoreStore.addStorage(
+    SQLiteStore(),
+    completion: { (result: SetupResult) -> Void in
+        switch result {
+        case .success(let storage):
+            // storage is the related StorageInterface instance
+        case .failure(let error):
+            // error is the CoreStoreError enum value for the failure
+        }
+    }
+)
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + success(_:) + +
    +
    +
    +
    +
    +
    +

    SetupResult.success indicates that the storage setup succeeded. The associated object for this enum value is the related StorageInterface instance.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case success(T)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + failure(_:) + +
    +
    +
    +
    +
    +
    +

    SetupResult.failure indicates that the storage setup failed. The associated object for this value is the related CoreStoreError enum value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case failure(CoreStoreError)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + isSuccess + +
    +
    +
    +
    +
    +
    +

    Returns true if the result indicates .success, false if the result is .failure.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isSuccess: Bool { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == <T, U>(lhs: SetupResult<T>, rhs: SetupResult<U>) -> Bool where T : StorageInterface, U : StorageInterface
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Enums/TransformableContainer.html b/docs/Enums/TransformableContainer.html new file mode 100644 index 0000000..3e5dbee --- /dev/null +++ b/docs/Enums/TransformableContainer.html @@ -0,0 +1,890 @@ + + + + TransformableContainer Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

TransformableContainer

+
+
+
public enum TransformableContainer<O> where O : CoreStoreObject
+ +
+
+

The containing type for transformable properties. Use the DynamicObject.Transformable typealias instead for shorter syntax.

+
class Animal: CoreStoreObject {
+    let species = Value.Required<String>("species", initial: "")
+    let nickname = Value.Optional<String>("nickname")
+    let color = Transformable.Optional<UIColor>("color")
+}
+
+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + Required + +
    +
    +
    +
    +
    +
    +

    The containing type for transformable properties. Any type that conforms to NSCoding & NSCopying are supported.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let nickname = Value.Optional<String>("nickname")
    +    let color = Transformable.Optional<UIColor>("color")
    +}
    +
    +
    +

    Important

    + Transformable.Required properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class Required<V> : AttributeProtocol where V : NSCoding, V : NSCopying
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + Optional + +
    +
    +
    +
    +
    +
    +

    The containing type for optional transformable properties. Any type that conforms to NSCoding & NSCopying are supported.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let nickname = Value.Optional<String>("nickname")
    +    let color = Transformable.Optional<UIColor>("color")
    +}
    +
    +
    +

    Important

    + Transformable.Optional properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class Optional<V> : AttributeProtocol where V : NSCoding, V : NSCopying
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Enums/TransformableContainer/Optional.html b/docs/Enums/TransformableContainer/Optional.html new file mode 100644 index 0000000..0612861 --- /dev/null +++ b/docs/Enums/TransformableContainer/Optional.html @@ -0,0 +1,1257 @@ + + + + Optional Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Optional

+
+
+
public final class Optional<V> : AttributeProtocol where V : NSCoding, V : NSCopying
+ +
+
+

The containing type for optional transformable properties. Any type that conforms to NSCoding & NSCopying are supported.

+
class Animal: CoreStoreObject {
+    let species = Value.Required<String>("species", initial: "")
+    let nickname = Value.Optional<String>("nickname")
+    let color = Transformable.Optional<UIColor>("color")
+}
+
+
+

Important

+ Transformable.Optional properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the property.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let color = Transformable.Optional<UIColor>(
    +        "color",
    +        isTransient: true,
    +        customGetter: Animal.getColor(_:)
    +    )
    +}
    +
    +private static func getColor(_ partialObject: PartialObject<Animal>) -> UIColor? {
    +    if let cachedColor = partialObject.primitiveValue(for: { $0.color }) {
    +        return cachedColor
    +    }
    +    let color: UIColor?
    +    switch partialObject.value(for: { $0.species }) {
    +
    +    case "Swift": color = UIColor.orange
    +    case "Bulbasaur": color = UIColor.green
    +    default: return nil
    +    }
    +    partialObject.setPrimitiveValue(color, for: { $0.color })
    +    return color
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(
    +    _ keyPath: KeyPathString,
    +    initial: @autoclosure @escaping () -> V? = nil,
    +    isTransient: Bool = false,
    +    allowsExternalBinaryDataStorage: Bool = false,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    customGetter: ((_ partialObject: PartialObject<O>) -> V?)? = nil,
    +    customSetter: ((_ partialObject: PartialObject<O>, _ newValue: V?) -> Void)? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent attribute name for this property.

    +
    +
    + + initial + + +
    +

    the initial value for the property when the object is first created. Defaults to the ImportableAttributeType‘s empty value if not specified.

    +
    +
    + + isTransient + + +
    +

    true if the property is transient, otherwise false. Defaults to false if not specified. The transient flag specifies whether or not a property’s value is ignored when an object is saved to a persistent store. Transient properties are not saved to the persistent store, but are still managed for undo, redo, validation, and so on.

    +
    +
    + + allowsExternalBinaryDataStorage + + +
    +

    true if the attribute allows external binary storage, otherwise false.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a property as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + customGetter + + +
    +

    use this closure as an override for the default property getter. The closure receives a PartialObject<O>, which acts as a fast, type-safe KVC interface for CoreStoreObject. The reason a CoreStoreObject instance is not passed directly is because the Core Data runtime is not aware of CoreStoreObject properties’ static typing, and so loading those info everytime KVO invokes this accessor method incurs a cumulative performance hit (especially in KVO-heavy operations such as ListMonitor observing.) When accessing the property value from PartialObject<O>, make sure to use PartialObject<O>.primitiveValue(for:) instead of PartialObject<O>.value(for:), which would unintentionally execute the same closure again recursively.

    +
    +
    + + customSetter + + +
    +

    use this closure as an override for the default property setter. The closure receives a PartialObject<O>, which acts as a fast, type-safe KVC interface for CoreStoreObject. The reason a CoreStoreObject instance is not passed directly is because the Core Data runtime is not aware of CoreStoreObject properties’ static typing, and so loading those info everytime KVO invokes this accessor method incurs a cumulative performance hit (especially in KVO-heavy operations such as ListMonitor observing.) When accessing the property value from PartialObject<O>, make sure to use PartialObject<O>.setPrimitiveValue(_:for:) instead of PartialObject<O>.setValue(_:for:), which would unintentionally execute the same closure again recursively.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + value + +
    +
    +
    +
    +
    +
    +

    The property value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var value: V? { get set }
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = O
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ValueType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ValueType = V
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_keyPathString + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var cs_keyPathString: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns an optional transformable value to the property. The operation

    +
    animal.color .= UIColor.red
    +
    + +

    is equivalent to

    +
    animal.color.value = UIColor.red
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= (property: TransformableContainer<O>.Optional<V>, newValue: V?)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns an optional transformable value from another property. The operation

    +
    animal.color .= anotherAnimal.color
    +
    + +

    is equivalent to

    +
    animal.color.value = anotherAnimal.color.value
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= <O2>(property: TransformableContainer<O>.Optional<V>, property2: TransformableContainer<O2>.Optional<V>) where O2 : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns a transformable value from another property. The operation

    +
    animal.color .= anotherAnimal.color
    +
    + +

    is equivalent to

    +
    animal.color.value = anotherAnimal.color.value
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= <O2>(property: TransformableContainer<O>.Optional<V>, property2: TransformableContainer<O2>.Required<V>) where O2 : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Enums/TransformableContainer/Required.html b/docs/Enums/TransformableContainer/Required.html new file mode 100644 index 0000000..dcfe40e --- /dev/null +++ b/docs/Enums/TransformableContainer/Required.html @@ -0,0 +1,1227 @@ + + + + Required Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Required

+
+
+
public final class Required<V> : AttributeProtocol where V : NSCoding, V : NSCopying
+ +
+
+

The containing type for transformable properties. Any type that conforms to NSCoding & NSCopying are supported.

+
class Animal: CoreStoreObject {
+    let species = Value.Required<String>("species", initial: "")
+    let nickname = Value.Optional<String>("nickname")
+    let color = Transformable.Optional<UIColor>("color")
+}
+
+
+

Important

+ Transformable.Required properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the property.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let color = Transformable.Required<UIColor>(
    +        "color",
    +        initial: UIColor.clear,
    +        isTransient: true,
    +        customGetter: Animal.getColor(_:)
    +    )
    +}
    +
    +private static func getColor(_ partialObject: PartialObject<Animal>) -> UIColor {
    +    let cachedColor = partialObject.primitiveValue(for: { $0.color })
    +    if cachedColor != UIColor.clear {
    +
    +        return cachedColor
    +    }
    +    let color: UIColor
    +    switch partialObject.value(for: { $0.species }) {
    +
    +    case "Swift": color = UIColor.orange
    +    case "Bulbasaur": color = UIColor.green
    +    default: color = UIColor.black
    +    }
    +    partialObject.setPrimitiveValue(color, for: { $0.color })
    +    return color
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(
    +    _ keyPath: KeyPathString,
    +    initial: @autoclosure @escaping () -> V,
    +    isTransient: Bool = false,
    +    allowsExternalBinaryDataStorage: Bool = false,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    customGetter: ((_ partialObject: PartialObject<O>) -> V)? = nil,
    +    customSetter: ((_ partialObject: PartialObject<O>, _ newValue: V) -> Void)? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent attribute name for this property.

    +
    +
    + + initial + + +
    +

    the initial value for the property when the object is first created. Defaults to the ImportableAttributeType‘s empty value if not specified.

    +
    +
    + + isTransient + + +
    +

    true if the property is transient, otherwise false. Defaults to false if not specified. The transient flag specifies whether or not a property’s value is ignored when an object is saved to a persistent store. Transient properties are not saved to the persistent store, but are still managed for undo, redo, validation, and so on.

    +
    +
    + + allowsExternalBinaryDataStorage + + +
    +

    true if the attribute allows external binary storage, otherwise false.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a property as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + customGetter + + +
    +

    use this closure as an override for the default property getter. The closure receives a PartialObject<O>, which acts as a fast, type-safe KVC interface for CoreStoreObject. The reason a CoreStoreObject instance is not passed directly is because the Core Data runtime is not aware of CoreStoreObject properties’ static typing, and so loading those info everytime KVO invokes this accessor method incurs a cumulative performance hit (especially in KVO-heavy operations such as ListMonitor observing.) When accessing the property value from PartialObject<O>, make sure to use PartialObject<O>.primitiveValue(for:) instead of PartialObject<O>.value(for:), which would unintentionally execute the same closure again recursively.

    +
    +
    + + customSetter + + +
    +

    use this closure as an override for the default property setter. The closure receives a PartialObject<O>, which acts as a fast, type-safe KVC interface for CoreStoreObject. The reason a CoreStoreObject instance is not passed directly is because the Core Data runtime is not aware of CoreStoreObject properties’ static typing, and so loading those info everytime KVO invokes this accessor method incurs a cumulative performance hit (especially in KVO-heavy operations such as ListMonitor observing.) When accessing the property value from PartialObject<O>, make sure to use PartialObject<O>.setPrimitiveValue(_:for:) instead of PartialObject<O>.setValue(_:for:), which would unintentionally execute the same closure again recursively.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + value + +
    +
    +
    +
    +
    +
    +

    The property value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var value: V { get set }
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = O
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ValueType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ValueType = V
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_keyPathString + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var cs_keyPathString: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns a transformable value to the property. The operation

    +
    animal.color .= UIColor.red
    +
    + +

    is equivalent to

    +
    animal.color.value = UIColor.red
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= (property: TransformableContainer<O>.Required<V>, newValue: V)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns a transformable value from another property. The operation

    +
    animal.nickname .= anotherAnimal.species
    +
    + +

    is equivalent to

    +
    animal.nickname.value = anotherAnimal.species.value
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= <O2>(property: TransformableContainer<O>.Required<V>, property2: TransformableContainer<O2>.Required<V>) where O2 : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Enums/ValueContainer.html b/docs/Enums/ValueContainer.html new file mode 100644 index 0000000..71aaa65 --- /dev/null +++ b/docs/Enums/ValueContainer.html @@ -0,0 +1,890 @@ + + + + ValueContainer Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ValueContainer

+
+
+
public enum ValueContainer<O> where O : CoreStoreObject
+ +
+
+

The containing type for value properties. Use the DynamicObject.Value typealias instead for shorter syntax.

+
class Animal: CoreStoreObject {
+    let species = Value.Required<String>("species", initial: "")
+    let nickname = Value.Optional<String>("nickname")
+    let color = Transformable.Optional<UIColor>("color")
+}
+
+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + Required + +
    +
    +
    +
    +
    +
    +

    The containing type for required value properties. Any type that conforms to ImportableAttributeType are supported.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let nickname = Value.Optional<String>("nickname")
    +    let color = Transformable.Optional<UIColor>("color")
    +}
    +
    +
    +

    Important

    + Value.Required properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class Required<V> : AttributeProtocol where V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + Optional + +
    +
    +
    +
    +
    +
    +

    The containing type for optional value properties. Any type that conforms to ImportableAttributeType are supported.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let nickname = Value.Optional<String>("nickname")
    +    let color = Transformable.Optional<UIColor>("color")
    +}
    +
    +
    +

    Important

    + Value.Optional properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class Optional<V> : AttributeProtocol where V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Enums/ValueContainer/Optional.html b/docs/Enums/ValueContainer/Optional.html new file mode 100644 index 0000000..aee47d5 --- /dev/null +++ b/docs/Enums/ValueContainer/Optional.html @@ -0,0 +1,1647 @@ + + + + Optional Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Optional

+
+
+
public final class Optional<V> : AttributeProtocol where V : ImportableAttributeType
+ +
+
+

The containing type for optional value properties. Any type that conforms to ImportableAttributeType are supported.

+
class Animal: CoreStoreObject {
+    let species = Value.Required<String>("species", initial: "")
+    let nickname = Value.Optional<String>("nickname")
+    let color = Transformable.Optional<UIColor>("color")
+}
+
+
+

Important

+ Value.Optional properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the property.

    +
    class Person: CoreStoreObject {
    +    let title = Value.Optional<String>("title", initial: "Mr.")
    +    let name = Value.Optional<String>("name")
    +    let displayName = Value.Optional<String>(
    +        "displayName",
    +        isTransient: true,
    +        customGetter: Person.getName(_:)
    +    )
    +
    +    private static func getName(_ partialObject: PartialObject<Person>) -> String? {
    +        if let cachedDisplayName = partialObject.primitiveValue(for: { $0.displayName }) {
    +           return cachedDisplayName
    +        }
    +        let title = partialObject.value(for: { $0.title })
    +        let name = partialObject.value(for: { $0.name })
    +        let displayName = "\(title) \(name)"
    +        partialObject.setPrimitiveValue(displayName, for: { $0.displayName })
    +        return displayName
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(
    +    _ keyPath: KeyPathString,
    +    initial: @autoclosure @escaping () -> V? = nil,
    +    isTransient: Bool = false,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    customGetter: ((_ partialObject: PartialObject<O>) -> V?)? = nil,
    +    customSetter: ((_ partialObject: PartialObject<O>, _ newValue: V?) -> Void)? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent attribute name for this property.

    +
    +
    + + initial + + +
    +

    the initial value for the property when the object is first created. Defaults to nil if not specified.

    +
    +
    + + isTransient + + +
    +

    true if the property is transient, otherwise false. Defaults to false if not specified. The transient flag specifies whether or not a property’s value is ignored when an object is saved to a persistent store. Transient properties are not saved to the persistent store, but are still managed for undo, redo, validation, and so on.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a property as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + customGetter + + +
    +

    use this closure to make final transformations to the property’s value before returning from the getter.

    +
    +
    + + self + + +
    +

    the CoreStoreObject

    +
    +
    + + getValue + + +
    +

    the original getter for the property

    +
    +
    + + customSetter + + +
    +

    use this closure to make final transformations to the new value before assigning to the property.

    +
    +
    + + setValue + + +
    +

    the original setter for the property

    +
    +
    + + finalNewValue + + +
    +

    the transformed new value

    +
    +
    + + originalNewValue + + +
    +

    the original new value

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + value + +
    +
    +
    +
    +
    +
    +

    The property value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var value: V? { get set }
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where({ $0.nickname == "John" }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (attribute: ValueContainer<O>.Optional<V>, value: V?) -> Where<O>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is not equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where({ $0.nickname != "John" }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func != (attribute: ValueContainer<O>.Optional<V>, value: V?) -> Where<O>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is less than a value

    +
    let person = CoreStore.fetchOne(From<Person>().where({ $0.age < 20 }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func < (attribute: ValueContainer<O>.Optional<V>, value: V?) -> Where<O>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is greater than a value

    +
    let person = CoreStore.fetchOne(From<Person>().where({ $0.age > 20 }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func > (attribute: ValueContainer<O>.Optional<V>, value: V?) -> Where<O>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + <=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is less than or equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where({ $0.age <= 20 }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func <= (attribute: ValueContainer<O>.Optional<V>, value: V?) -> Where<O>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is greater than or equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where({ $0.age >= 20 }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func >= (attribute: ValueContainer<O>.Optional<V>, value: V?) -> Where<O>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ~=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by checking if a sequence contains the value of a property

    +
    let dog = CoreStore.fetchOne(From<Dog>().where({ ["Pluto", "Snoopy", "Scooby"] ~= $0.nickname }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ~= <S>(sequence: S, attribute: ValueContainer<O>.Optional<V>) -> Where<O> where V == S.Element, S : Sequence
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = O
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ValueType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ValueType = V
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_keyPathString + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var cs_keyPathString: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns an optional value to the property. The operation

    +
    animal.nickname .= "Taylor"
    +
    + +

    is equivalent to

    +
    animal.nickname.value = "Taylor"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= (property: ValueContainer<O>.Optional<V>, newValue: V?)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns an optional value from another property. The operation

    +
    animal.nickname .= anotherAnimal.nickname
    +
    + +

    is equivalent to

    +
    animal.nickname.value = anotherAnimal.nickname.value
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= <O2>(property: ValueContainer<O>.Optional<V>, property2: ValueContainer<O2>.Optional<V>) where O2 : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns a value from another property. The operation

    +
    animal.nickname .= anotherAnimal.species
    +
    + +

    is equivalent to

    +
    animal.nickname.value = anotherAnimal.species.value
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= <O2>(property: ValueContainer<O>.Optional<V>, property2: ValueContainer<O2>.Required<V>) where O2 : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares equality between a property’s value and another value

    +
    if animal.species .== "Swift" { ... }
    +
    + +

    is equivalent to

    +
    if animal.species.value == "Swift" { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== (property: ValueContainer<O>.Optional<V>, value: V?) -> Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares equality between a property’s value and another property’s value

    +
    if "Swift" .== animal.species { ... }
    +
    + +

    is equivalent to

    +
    if "Swift" == animal.species.value { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== (value: V?, property: ValueContainer<O>.Optional<V>) -> Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares equality between a property’s value and another property’s value

    +
    if animal.species .== anotherAnimal.species { ... }
    +
    + +

    is equivalent to

    +
    if animal.species.value == anotherAnimal.species.value { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== (property: ValueContainer<O>.Optional<V>, property2: ValueContainer<O>.Optional<V>) -> Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares equality between a property’s value and another property’s value

    +
    if animal.species .== anotherAnimal.species { ... }
    +
    + +

    is equivalent to

    +
    if animal.species.value == anotherAnimal.species.value { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== (property: ValueContainer<O>.Optional<V>, property2: ValueContainer<O>.Required<V>) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Enums/ValueContainer/Required.html b/docs/Enums/ValueContainer/Required.html new file mode 100644 index 0000000..8e7bf99 --- /dev/null +++ b/docs/Enums/ValueContainer/Required.html @@ -0,0 +1,1556 @@ + + + + Required Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Required

+
+
+
public final class Required<V> : AttributeProtocol where V : ImportableAttributeType
+ +
+
+

The containing type for required value properties. Any type that conforms to ImportableAttributeType are supported.

+
class Animal: CoreStoreObject {
+    let species = Value.Required<String>("species", initial: "")
+    let nickname = Value.Optional<String>("nickname")
+    let color = Transformable.Optional<UIColor>("color")
+}
+
+
+

Important

+ Value.Required properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the property.

    +
    class Person: CoreStoreObject {
    +    let title = Value.Required<String>("title", initial: "Mr.")
    +    let name = Value.Required<String>("name", initial: "")
    +    let displayName = Value.Required<String>(
    +        "displayName",
    +        initial: "",
    +        isTransient: true,
    +        customGetter: Person.getName(_:)
    +    )
    +
    +    private static func getName(_ partialObject: PartialObject<Person>) -> String {
    +        let cachedDisplayName = partialObject.primitiveValue(for: { $0.displayName })
    +        if !cachedDisplayName.isEmpty {
    +            return cachedDisplayName
    +        }
    +        let title = partialObject.value(for: { $0.title })
    +        let name = partialObject.value(for: { $0.name })
    +        let displayName = "\(title) \(name)"
    +        partialObject.setPrimitiveValue(displayName, for: { $0.displayName })
    +        return displayName
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(
    +    _ keyPath: KeyPathString,
    +    initial: @autoclosure @escaping () -> V,
    +    isTransient: Bool = false,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    customGetter: ((_ partialObject: PartialObject<O>) -> V)? = nil,
    +    customSetter: ((_ partialObject: PartialObject<O>, _ newValue: V) -> Void)? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent attribute name for this property.

    +
    +
    + + initial + + +
    +

    the initial value for the property when the object is first created

    +
    +
    + + isTransient + + +
    +

    true if the property is transient, otherwise false. Defaults to false if not specified. The transient flag specifies whether or not a property’s value is ignored when an object is saved to a persistent store. Transient properties are not saved to the persistent store, but are still managed for undo, redo, validation, and so on.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a property as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + customGetter + + +
    +

    use this closure as an override for the default property getter. The closure receives a PartialObject<O>, which acts as a fast, type-safe KVC interface for CoreStoreObject. The reason a CoreStoreObject instance is not passed directly is because the Core Data runtime is not aware of CoreStoreObject properties’ static typing, and so loading those info everytime KVO invokes this accessor method incurs a cumulative performance hit (especially in KVO-heavy operations such as ListMonitor observing.) When accessing the property value from PartialObject<O>, make sure to use PartialObject<O>.primitiveValue(for:) instead of PartialObject<O>.value(for:), which would unintentionally execute the same closure again recursively.

    +
    +
    + + customSetter + + +
    +

    use this closure as an override for the default property setter. The closure receives a PartialObject<O>, which acts as a fast, type-safe KVC interface for CoreStoreObject. The reason a CoreStoreObject instance is not passed directly is because the Core Data runtime is not aware of CoreStoreObject properties’ static typing, and so loading those info everytime KVO invokes this accessor method incurs a cumulative performance hit (especially in KVO-heavy operations such as ListMonitor observing.) When accessing the property value from PartialObject<O>, make sure to use PartialObject<O>.setPrimitiveValue(_:for:) instead of PartialObject<O>.setValue(_:for:), which would unintentionally execute the same closure again recursively.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + value + +
    +
    +
    +
    +
    +
    +

    The property value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var value: V { get set }
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where({ $0.nickname == "John" }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (attribute: ValueContainer<O>.Required<V>, value: V) -> Where<O>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is not equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where({ $0.nickname != "John" }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func != (attribute: ValueContainer<O>.Required<V>, value: V) -> Where<O>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is less than a value

    +
    let person = CoreStore.fetchOne(From<Person>().where({ $0.age < 20 }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func < (attribute: ValueContainer<O>.Required<V>, value: V) -> Where<O>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is greater than a value

    +
    let person = CoreStore.fetchOne(From<Person>().where({ $0.age > 20 }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func > (attribute: ValueContainer<O>.Required<V>, value: V) -> Where<O>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + <=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is less than or equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where({ $0.age <= 20 }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func <= (attribute: ValueContainer<O>.Required<V>, value: V) -> Where<O>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is greater than or equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where({ $0.age >= 20 }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func >= (attribute: ValueContainer<O>.Required<V>, value: V) -> Where<O>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ~=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by checking if a sequence contains the value of a property

    +
    let dog = CoreStore.fetchOne(From<Dog>().where({ ["Pluto", "Snoopy", "Scooby"] ~= $0.nickname }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ~= <S>(sequence: S, attribute: ValueContainer<O>.Required<V>) -> Where<O> where V == S.Element, S : Sequence
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = O
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ValueType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ValueType = V
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_keyPathString + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var cs_keyPathString: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns a value to the property. The operation

    +
    animal.species .= "Swift"
    +
    + +

    is equivalent to

    +
    animal.species.value = "Swift"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= (property: ValueContainer<O>.Required<V>, newValue: V)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns a value from another property. The operation

    +
    animal.species .= anotherAnimal.species
    +
    + +

    is equivalent to

    +
    animal.species.value = anotherAnimal.species.value
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= <O2>(property: ValueContainer<O>.Required<V>, property2: ValueContainer<O2>.Required<V>) where O2 : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares equality between a property’s value and another value

    +
    if animal.species .== "Swift" { ... }
    +
    + +

    is equivalent to

    +
    if animal.species.value == "Swift" { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== (property: ValueContainer<O>.Required<V>, value: V?) -> Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares equality between a value and a property’s value

    +
    if "Swift" .== animal.species { ... }
    +
    + +

    is equivalent to

    +
    if "Swift" == animal.species.value { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== (value: V?, property: ValueContainer<O>.Required<V>) -> Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares equality between a property’s value and another property’s value

    +
    if animal.species .== anotherAnimal.species { ... }
    +
    + +

    is equivalent to

    +
    if animal.species.value == anotherAnimal.species.value { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== (property: ValueContainer<O>.Required<V>, property2: ValueContainer<O>.Required<V>) -> Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares equality between a property’s value and another property’s value

    +
    if animal.species .== anotherAnimal.species { ... }
    +
    + +

    is equivalent to

    +
    if animal.species.value == anotherAnimal.species.value { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== (property: ValueContainer<O>.Required<V>, property2: ValueContainer<O>.Optional<V>) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions.html b/docs/Extensions.html new file mode 100644 index 0000000..fe59e63 --- /dev/null +++ b/docs/Extensions.html @@ -0,0 +1,1881 @@ + + + + Extensions Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Extensions

+

The following extensions are available globally.

+ +
+
+ +
+
+
+ + +
+
+ +
    +
  • +
    + + + + KeyPath + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    class KeyPath<Root, Value> : PartialKeyPath<Root>
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + NSManagedObject + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    class NSManagedObject : NSObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + RawRepresentable + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    protocol RawRepresentable
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    class NSManagedObjectContext : NSObject, NSCoding, NSLocking
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + Sequence + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    protocol Sequence
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + Progress + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    class Progress : NSObject
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Bool

+
+
+
    +
  • +
    + + + + Bool + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CGFloat + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct CGFloat
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Data

+
+
+
    +
  • +
    + + + + Data + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessCollection, MutableCollection, RangeReplaceableCollection
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Date

+
+
+
    +
  • +
    + + + + Date + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct Date : ReferenceConvertible, Comparable, Equatable
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Double

+
+
+
    +
  • +
    + + + + Double + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct Double
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Float

+
+
+
    +
  • +
    + + + + Float + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct Float
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Int

+
+
+
    +
  • +
    + + + + Int + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct Int : FixedWidthInteger, SignedInteger
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Int8

+
+
+
    +
  • +
    + + + + Int8 + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct Int8 : FixedWidthInteger, SignedInteger
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Int16

+
+
+
    +
  • +
    + + + + Int16 + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct Int16 : FixedWidthInteger, SignedInteger
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Int32

+
+
+
    +
  • +
    + + + + Int32 + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct Int32 : FixedWidthInteger, SignedInteger
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Int64

+
+
+
    +
  • +
    + + + + Int64 + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct Int64 : FixedWidthInteger, SignedInteger
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

NSData

+
+
+
    +
  • +
    + + + + NSData + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    class NSData : NSObject, NSCopying, NSMutableCopying, NSSecureCoding
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

NSDate

+
+
+
    +
  • +
    + + + + NSDate + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    class NSDate : NSObject, NSCopying, NSSecureCoding
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + NSManagedObjectID + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    class NSManagedObjectID : NSObject, NSCopying
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

NSNull

+
+
+
    +
  • +
    + + + + NSNull + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    class NSNull : NSObject, NSCopying, NSSecureCoding
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + NSNumber + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    class NSNumber : NSValue
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + NSString + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    class NSString : NSObject, NSCopying, NSMutableCopying, NSSecureCoding
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

NSURL

+
+
+
    +
  • +
    + + + + NSURL + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    class NSURL : NSObject, NSSecureCoding, NSCopying
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

NSUUID

+
+
+
    +
  • +
    + + + + NSUUID + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    class NSUUID : NSObject, NSCopying, NSSecureCoding
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

String

+
+
+
    +
  • +
    + + + + String + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct String
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

URL

+
+
+
    +
  • +
    + + + + URL + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct URL : ReferenceConvertible, Equatable
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

UUID

+
+
+
    +
  • +
    + + + + UUID + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.8, iOS 6.0, *)
    +struct UUID : ReferenceConvertible, Hashable, Equatable, CustomStringConvertible
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions/Bool.html b/docs/Extensions/Bool.html new file mode 100644 index 0000000..0b38074 --- /dev/null +++ b/docs/Extensions/Bool.html @@ -0,0 +1,893 @@ + + + + Bool Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Bool

+
+
+
struct Bool
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSNumber
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let cs_rawAttributeType: NSAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> Bool?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions/CGFloat.html b/docs/Extensions/CGFloat.html new file mode 100644 index 0000000..e294427 --- /dev/null +++ b/docs/Extensions/CGFloat.html @@ -0,0 +1,893 @@ + + + + CGFloat Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CGFloat

+
+
+
struct CGFloat
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSNumber
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let cs_rawAttributeType: NSAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> CGFloat?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions/Data.html b/docs/Extensions/Data.html new file mode 100644 index 0000000..9c7015a --- /dev/null +++ b/docs/Extensions/Data.html @@ -0,0 +1,893 @@ + + + + Data Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Data

+
+
+
struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessCollection, MutableCollection, RangeReplaceableCollection
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSData
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let cs_rawAttributeType: NSAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> Data?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions/Date.html b/docs/Extensions/Date.html new file mode 100644 index 0000000..d991672 --- /dev/null +++ b/docs/Extensions/Date.html @@ -0,0 +1,893 @@ + + + + Date Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Date

+
+
+
struct Date : ReferenceConvertible, Comparable, Equatable
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSDate
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let cs_rawAttributeType: NSAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> Date?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions/Double.html b/docs/Extensions/Double.html new file mode 100644 index 0000000..e5f5eab --- /dev/null +++ b/docs/Extensions/Double.html @@ -0,0 +1,893 @@ + + + + Double Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Double

+
+
+
struct Double
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSNumber
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let cs_rawAttributeType: NSAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> Double?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions/Float.html b/docs/Extensions/Float.html new file mode 100644 index 0000000..e42b7d2 --- /dev/null +++ b/docs/Extensions/Float.html @@ -0,0 +1,893 @@ + + + + Float Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Float

+
+
+
struct Float
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSNumber
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let cs_rawAttributeType: NSAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> Float?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions/Int.html b/docs/Extensions/Int.html new file mode 100644 index 0000000..6112bb6 --- /dev/null +++ b/docs/Extensions/Int.html @@ -0,0 +1,893 @@ + + + + Int Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Int

+
+
+
struct Int : FixedWidthInteger, SignedInteger
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSNumber
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let cs_rawAttributeType: NSAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> Int?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions/Int16.html b/docs/Extensions/Int16.html new file mode 100644 index 0000000..c4fad99 --- /dev/null +++ b/docs/Extensions/Int16.html @@ -0,0 +1,893 @@ + + + + Int16 Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Int16

+
+
+
struct Int16 : FixedWidthInteger, SignedInteger
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSNumber
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let cs_rawAttributeType: NSAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> Int16?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions/Int32.html b/docs/Extensions/Int32.html new file mode 100644 index 0000000..0296085 --- /dev/null +++ b/docs/Extensions/Int32.html @@ -0,0 +1,893 @@ + + + + Int32 Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Int32

+
+
+
struct Int32 : FixedWidthInteger, SignedInteger
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSNumber
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let cs_rawAttributeType: NSAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> Int32?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions/Int64.html b/docs/Extensions/Int64.html new file mode 100644 index 0000000..2c02cd7 --- /dev/null +++ b/docs/Extensions/Int64.html @@ -0,0 +1,893 @@ + + + + Int64 Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Int64

+
+
+
struct Int64 : FixedWidthInteger, SignedInteger
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSNumber
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let cs_rawAttributeType: NSAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> Int64?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions/Int8.html b/docs/Extensions/Int8.html new file mode 100644 index 0000000..2f46222 --- /dev/null +++ b/docs/Extensions/Int8.html @@ -0,0 +1,893 @@ + + + + Int8 Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Int8

+
+
+
struct Int8 : FixedWidthInteger, SignedInteger
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSNumber
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let cs_rawAttributeType: NSAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> Int8?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions/KeyPath.html b/docs/Extensions/KeyPath.html new file mode 100644 index 0000000..3a0b001 --- /dev/null +++ b/docs/Extensions/KeyPath.html @@ -0,0 +1,865 @@ + + + + KeyPath Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

KeyPath

+
+
+
class KeyPath<Root, Value> : PartialKeyPath<Root>
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = Root
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ValueType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ValueType = Value
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_keyPathString + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var cs_keyPathString: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions/KeyPathString.html b/docs/Extensions/KeyPathString.html new file mode 100644 index 0000000..e91085d --- /dev/null +++ b/docs/Extensions/KeyPathString.html @@ -0,0 +1,845 @@ + + + + KeyPathString Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

KeyPathString

+
+
+
public typealias KeyPathString = String
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + init(keyPath:) + +
    +
    +
    +
    +
    +
    +

    Extracts the keyPath string from the property.

    +
    let keyPath = String(keyPath: \Person.nickname)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<O, V>(keyPath: KeyPath<O, V>) where O : NSManagedObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(keyPath:) + +
    +
    +
    +
    +
    +
    +

    Extracts the keyPath string from the property.

    +
    let keyPath = String(keyPath: \Person.nickname)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<O, K>(keyPath: KeyPath<O, K>) where O : CoreStoreObject, K : DynamicKeyPath
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions/NSData.html b/docs/Extensions/NSData.html new file mode 100644 index 0000000..5f665c1 --- /dev/null +++ b/docs/Extensions/NSData.html @@ -0,0 +1,896 @@ + + + + NSData Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

NSData

+
+
+
class NSData : NSObject, NSCopying, NSMutableCopying, NSSecureCoding
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSData
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public class var cs_rawAttributeType: NSAttributeType { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public class func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> `Self`?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions/NSDate.html b/docs/Extensions/NSDate.html new file mode 100644 index 0000000..1f59a84 --- /dev/null +++ b/docs/Extensions/NSDate.html @@ -0,0 +1,896 @@ + + + + NSDate Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

NSDate

+
+
+
class NSDate : NSObject, NSCopying, NSSecureCoding
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSDate
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public class var cs_rawAttributeType: NSAttributeType { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public class func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> `Self`?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions/NSManagedObject.html b/docs/Extensions/NSManagedObject.html new file mode 100644 index 0000000..050e864 --- /dev/null +++ b/docs/Extensions/NSManagedObject.html @@ -0,0 +1,1675 @@ + + + + NSManagedObject Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

NSManagedObject

+
+
+
class NSManagedObject : NSObject
+ +
+
+ +
+
+ +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class func cs_forceCreate(entityDescription: NSEntityDescription, into context: NSManagedObjectContext, assignTo store: NSPersistentStore) -> Self
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_fromRaw(object:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class func cs_fromRaw(object: NSManagedObject) -> Self
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_matches(object:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func cs_matches(object: NSManagedObject) -> Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_id() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cs_id() -> NSManagedObjectID
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_toRaw() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cs_toRaw() -> NSManagedObject
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + fetchSource() + +
    +
    +
    +
    +
    +
    +

    Exposes a FetchableSource that can fetch sibling objects of this NSManagedObject instance. This may be the DataStack, a BaseDataTransaction, the NSManagedObjectContext itself, or nil if the obejct’s parent is already deallocated.

    +
    +

    Warning

    + Future implementations may change the instance returned by this method depending on the timing or condition that fetchSource() was called. Do not make assumptions that the instance will be a specific instance. If the NSManagedObjectContext instance is desired, use the FetchableSource.unsafeContext() method to get the correct instance. Also, do not assume that the fetchSource() and querySource() return the same instance all the time. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchSource() -> FetchableSource?
    + +
    +
    +
    +

    Return Value

    +

    a FetchableSource that can fetch sibling objects of this NSManagedObject instance. This may be the DataStack, a BaseDataTransaction, the NSManagedObjectContext itself, or nil if the object’s parent is already deallocated.

    +
    +
    +
    +
  • +
  • +
    + + + + querySource() + +
    +
    +
    +
    +
    +
    +

    Exposes a QueryableSource that can query attributes and aggregate values. This may be the DataStack, a BaseDataTransaction, the NSManagedObjectContext itself, or nil if the obejct’s parent is already deallocated.

    +
    +

    Warning

    + Future implementations may change the instance returned by this method depending on the timing or condition that querySource() was called. Do not make assumptions that the instance will be a specific instance. If the NSManagedObjectContext instance is desired, use the QueryableSource.unsafeContext() method to get the correct instance. Also, do not assume that the fetchSource() and querySource() return the same instance all the time. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func querySource() -> QueryableSource?
    + +
    +
    +
    +

    Return Value

    +

    a QueryableSource that can query attributes and aggregate values. This may be the DataStack, a BaseDataTransaction, the NSManagedObjectContext itself, or nil if the object’s parent is already deallocated.

    +
    +
    +
    +
  • +
  • +
    + + + + getValue(forKvcKey:) + +
    +
    +
    +
    +
    +
    +

    Provides a convenience wrapper for accessing primitiveValue(forKey:) with proper calls to willAccessValue(forKey:) and didAccessValue(forKey:). This is useful when implementing accessor methods for transient attributes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public func getValue(forKvcKey kvcKey: KeyPathString) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + kvcKey + + +
    +

    the KVC key

    +
    +
    +
    +
    +

    Return Value

    +

    the primitive value for the KVC key

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Provides a convenience wrapper for accessing primitiveValue(forKey:) with proper calls to willAccessValue(forKey:) and didAccessValue(forKey:). This is useful when implementing accessor methods for transient attributes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public func getValue<T>(forKvcKey kvcKey: KeyPathString, didGetValue: (Any?) throws -> T) rethrows -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + kvcKey + + +
    +

    the KVC key

    +
    +
    + + didGetValue + + +
    +

    a closure to transform the primitive value

    +
    +
    +
    +
    +

    Return Value

    +

    the primitive value transformed by the didGetValue closure

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Provides a convenience wrapper for accessing primitiveValue(forKey:) with proper calls to willAccessValue(forKey:) and didAccessValue(forKey:). This is useful when implementing accessor methods for transient attributes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public func getValue<T>(forKvcKey kvcKey: KeyPathString, willGetValue: () throws -> Void, didGetValue: (Any?) throws -> T) rethrows -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + kvcKey + + +
    +

    the KVC key

    +
    +
    + + willGetValue + + +
    +

    called before accessing primitiveValue(forKey:). Callers are allowed to cancel the access by throwing an error.

    +
    +
    + + didGetValue + + +
    +

    a closure to transform the primitive value

    +
    +
    +
    +
    +

    Return Value

    +

    the primitive value transformed by the didGetValue closure

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Provides a convenience wrapper for setting setPrimitiveValue(_:forKey:) with proper calls to willChangeValue(forKey:) and didChangeValue(forKey:). This is useful when implementing mutator methods for transient attributes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public func setValue(_ value: Any?, forKvcKey KVCKey: KeyPathString)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + value + + +
    +

    the value to set the KVC key with

    +
    +
    + + KVCKey + + +
    +

    the KVC key

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Provides a convenience wrapper for setting setPrimitiveValue(_:forKey:) with proper calls to willChangeValue(forKey:) and didChangeValue(forKey:).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public func setValue(_ value: Any?, forKvcKey KVCKey: KeyPathString, didSetValue: () -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + value + + +
    +

    the value to set the KVC key with

    +
    +
    + + KVCKey + + +
    +

    the KVC key

    +
    +
    + + didSetValue + + +
    +

    called after executing setPrimitiveValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Provides a convenience wrapper for setting setPrimitiveValue(_:forKey:) with proper calls to willChangeValue(forKey:) and didChangeValue(forKey:). This is useful when implementing mutator methods for transient attributes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public func setValue<T>(_ value: T, forKvcKey KVCKey: KeyPathString, willSetValue: (T) throws -> Any?, didSetValue: (Any?) -> Void = { _ in }) rethrows
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + value + + +
    +

    the value to set the KVC key with

    +
    +
    + + KVCKey + + +
    +

    the KVC key

    +
    +
    + + willSetValue + + +
    +

    called before accessing setPrimitiveValue(forKey:). Callers are allowed to cancel the mutation by throwing an error, for example, for custom validations.

    +
    +
    + + didSetValue + + +
    +

    called after executing setPrimitiveValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + refreshAsFault() + +
    +
    +
    +
    +
    +
    +

    Re-faults the object to use the latest values from the persistent store

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func refreshAsFault()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + refreshAndMerge() + +
    +
    +
    +
    +
    +
    +

    Re-faults the object to use the latest values from the persistent store and merges previously pending changes back

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func refreshAndMerge()
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Provides a convenience wrapper for accessing -primitiveValueForKey: with proper calls to -willAccessValueForKey: and -didAccessValueForKey:. This is useful when implementing accessor methods for transient attributes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func cs_accessValueForKVCKey(_ KVCKey: KeyPathString) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + KVCKey + + +
    +

    the KVC key

    +
    +
    +
    +
    +

    Return Value

    +

    the primitive value for the KVC key

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Provides a convenience wrapper for setting -setPrimitiveValue: with proper calls to -willChangeValueForKey: and -didChangeValueForKey:. This is useful when implementing mutator methods for transient attributes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func cs_setValue(_ value: Any?, forKVCKey KVCKey: KeyPathString)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + value + + +
    +

    the value to set the KVC key with

    +
    +
    + + KVCKey + + +
    +

    the KVC key

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_refreshAsFault() + +
    +
    +
    +
    +
    +
    +

    Re-faults the object to use the latest values from the persistent store

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func cs_refreshAsFault()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_refreshAndMerge() + +
    +
    +
    +
    +
    +
    +

    Re-faults the object to use the latest values from the persistent store and merges previously pending changes back

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func cs_refreshAndMerge()
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + unsafeDataTransaction + +
    +
    +
    +
    +
    +
    +

    Returns this object’s parent UnsafeDataTransaction instance if it was created from one. Returns nil if the parent transaction is either an AsynchronousDataTransaction or a SynchronousDataTransaction, or if the object is not managed by CoreStore.

    + +

    When using an UnsafeDataTransaction and passing around a temporary object, you can use this property to execute fetches and updates to the transaction without having to pass around both the object and the transaction instances.

    +
    +

    Important

    + The internal reference to the transaction is weak, and it is still the developer’s responsibility to retain a strong reference to the UnsafeDataTransaction. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public var unsafeDataTransaction: UnsafeDataTransaction? { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions/NSManagedObjectContext.html b/docs/Extensions/NSManagedObjectContext.html new file mode 100644 index 0000000..1cc6acd --- /dev/null +++ b/docs/Extensions/NSManagedObjectContext.html @@ -0,0 +1,1517 @@ + + + + NSManagedObjectContext Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

NSManagedObjectContext

+
+
+
class NSManagedObjectContext : NSObject, NSCoding, NSLocking
+ +
+
+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchExisting<D>(_ object: D) -> D? where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchExisting<D>(_ objectID: NSManagedObjectID) -> D? where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchExisting<D, S>(_ objects: S) -> [D] where D : DynamicObject, D == S.Element, S : Sequence
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchExisting<D, S>(_ objectIDs: S) -> [D] where D : DynamicObject, S : Sequence, S.Element == NSManagedObjectID
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchOne<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> D? where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchOne<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> D? where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchOne<B>(_ clauseChain: B) -> B.ObjectType? where B : FetchChainableBuilderType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchAll<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> [D]? where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchAll<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> [D]? where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchAll<B>(_ clauseChain: B) -> [B.ObjectType]? where B : FetchChainableBuilderType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchCount<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> Int? where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchCount<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> Int? where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchCount<B>(_ clauseChain: B) -> Int? where B : FetchChainableBuilderType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> NSManagedObjectID? where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> NSManagedObjectID? where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchObjectID<B>(_ clauseChain: B) -> NSManagedObjectID? where B : FetchChainableBuilderType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> [NSManagedObjectID]? where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> [NSManagedObjectID]? where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchObjectIDs<B>(_ clauseChain: B) -> [NSManagedObjectID]? where B : FetchChainableBuilderType
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + unsafeContext() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func unsafeContext() -> NSManagedObjectContext
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions/NSManagedObjectID.html b/docs/Extensions/NSManagedObjectID.html new file mode 100644 index 0000000..18f4276 --- /dev/null +++ b/docs/Extensions/NSManagedObjectID.html @@ -0,0 +1,896 @@ + + + + NSManagedObjectID Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

NSManagedObjectID

+
+
+
class NSManagedObjectID : NSObject, NSCopying
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSManagedObjectID
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public class var cs_rawAttributeType: NSAttributeType { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public class func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> `Self`?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions/NSNull.html b/docs/Extensions/NSNull.html new file mode 100644 index 0000000..c0259ad --- /dev/null +++ b/docs/Extensions/NSNull.html @@ -0,0 +1,896 @@ + + + + NSNull Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

NSNull

+
+
+
class NSNull : NSObject, NSCopying, NSSecureCoding
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSNull
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public class var cs_rawAttributeType: NSAttributeType { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public class func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> `Self`?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions/NSNumber.html b/docs/Extensions/NSNumber.html new file mode 100644 index 0000000..c0512fa --- /dev/null +++ b/docs/Extensions/NSNumber.html @@ -0,0 +1,896 @@ + + + + NSNumber Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

NSNumber

+
+
+
class NSNumber : NSValue
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSNumber
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public class var cs_rawAttributeType: NSAttributeType { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public class func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> `Self`?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions/NSString.html b/docs/Extensions/NSString.html new file mode 100644 index 0000000..22d54a5 --- /dev/null +++ b/docs/Extensions/NSString.html @@ -0,0 +1,896 @@ + + + + NSString Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

NSString

+
+
+
class NSString : NSObject, NSCopying, NSMutableCopying, NSSecureCoding
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSString
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public class var cs_rawAttributeType: NSAttributeType { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public class func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> `Self`?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions/NSURL.html b/docs/Extensions/NSURL.html new file mode 100644 index 0000000..0239e6d --- /dev/null +++ b/docs/Extensions/NSURL.html @@ -0,0 +1,896 @@ + + + + NSURL Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

NSURL

+
+
+
class NSURL : NSObject, NSSecureCoding, NSCopying
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSString
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public class var cs_rawAttributeType: NSAttributeType { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public class func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> `Self`?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions/NSUUID.html b/docs/Extensions/NSUUID.html new file mode 100644 index 0000000..8f10245 --- /dev/null +++ b/docs/Extensions/NSUUID.html @@ -0,0 +1,896 @@ + + + + NSUUID Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

NSUUID

+
+
+
class NSUUID : NSObject, NSCopying, NSSecureCoding
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSString
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public class var cs_rawAttributeType: NSAttributeType { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public class func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> `Self`?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions/Progress.html b/docs/Extensions/Progress.html new file mode 100644 index 0000000..b383222 --- /dev/null +++ b/docs/Extensions/Progress.html @@ -0,0 +1,885 @@ + + + + Progress Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Progress

+
+
+
class Progress : NSObject
+ +
+
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Sets a closure that the Progress calls whenever its fractionCompleted changes. You can use this instead of setting up KVO.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func setProgressHandler(_ closure: ((_ progress: Progress) -> Void)?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + closure + + +
    +

    the closure to execute on progress change

    +
    +
    +
    +
    +
    +
  • +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Sets a closure that the NSProgress calls whenever its fractionCompleted changes. You can use this instead of setting up KVO.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func cs_setProgressHandler(_ closure: ((_ progress: Progress) -> Void)?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + closure + + +
    +

    the closure to execute on progress change

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions/RawRepresentable.html b/docs/Extensions/RawRepresentable.html new file mode 100644 index 0000000..455c482 --- /dev/null +++ b/docs/Extensions/RawRepresentable.html @@ -0,0 +1,843 @@ + + + + RawRepresentable Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

RawRepresentable

+
+
+
protocol RawRepresentable
+ +
+
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Creates an instance of this type from its QueryableNativeType value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> Self?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates QueryableNativeType value from this instance.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions/Sequence.html b/docs/Extensions/Sequence.html new file mode 100644 index 0000000..1a4cf77 --- /dev/null +++ b/docs/Extensions/Sequence.html @@ -0,0 +1,872 @@ + + + + Sequence Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Sequence

+
+
+
protocol Sequence
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + combined() + +
    +
    +
    +
    +
    +
    +

    Combines multiple OrderBy predicates together

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func combined() -> OrderBy<Iterator.Element.ObjectType>
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + combinedByAnd() + +
    +
    +
    +
    +
    +
    +

    Combines multiple Where predicates together using AND operator

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func combinedByAnd() -> Where<Iterator.Element.ObjectType>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + combinedByOr() + +
    +
    +
    +
    +
    +
    +

    Combines multiple Where predicates together using OR operator

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func combinedByOr() -> Where<Iterator.Element.ObjectType>
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions/String.html b/docs/Extensions/String.html new file mode 100644 index 0000000..7f84afd --- /dev/null +++ b/docs/Extensions/String.html @@ -0,0 +1,893 @@ + + + + String Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

String

+
+
+
struct String
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSString
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let cs_rawAttributeType: NSAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> String?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions/URL.html b/docs/Extensions/URL.html new file mode 100644 index 0000000..30120c2 --- /dev/null +++ b/docs/Extensions/URL.html @@ -0,0 +1,893 @@ + + + + URL Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

URL

+
+
+
struct URL : ReferenceConvertible, Equatable
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSString
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let cs_rawAttributeType: NSAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> URL?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Extensions/UUID.html b/docs/Extensions/UUID.html new file mode 100644 index 0000000..de73001 --- /dev/null +++ b/docs/Extensions/UUID.html @@ -0,0 +1,894 @@ + + + + UUID Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

UUID

+
+
+
@available(OSX 10.8, iOS 6.0, *)
+struct UUID : ReferenceConvertible, Hashable, Equatable, CustomStringConvertible
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSString
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let cs_rawAttributeType: NSAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> UUID?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Functions.html b/docs/Functions.html new file mode 100644 index 0000000..3a56427 --- /dev/null +++ b/docs/Functions.html @@ -0,0 +1,2204 @@ + + + + Functions Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Functions

+

The following functions are available globally.

+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.nickname == "John"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <O, V>(keyPath: KeyPath<O, V>, value: V) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is not equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.nickname != "John"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <O, V>(keyPath: KeyPath<O, V>, value: V) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ~=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by checking if a sequence contains the value of a property

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(["Pluto", "Snoopy", "Scooby"] ~= \.nickname))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func ~= <O, V, S>(sequence: S, keyPath: KeyPath<O, V>) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V == S.Element, S : Sequence
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.nickname == "John"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <O, V>(keyPath: KeyPath<O, Optional<V>>, value: V?) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is not equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.nickname != "John"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <O, V>(keyPath: KeyPath<O, Optional<V>>, value: V?) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ~=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by checking if a sequence contains the value of a property

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(["Pluto", "Snoopy", "Scooby"] ~= \.nickname))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func ~= <O, V, S>(sequence: S, keyPath: KeyPath<O, Optional<V>>) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V == S.Element, S : Sequence
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is less than a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age < 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func < <O, V>(keyPath: KeyPath<O, V>, value: V) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V : Comparable
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is greater than a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age > 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func > <O, V>(keyPath: KeyPath<O, V>, value: V) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V : Comparable
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + <=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is less than or equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age <= 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func <= <O, V>(keyPath: KeyPath<O, V>, value: V) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V : Comparable
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is greater than or equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age >= 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func >= <O, V>(keyPath: KeyPath<O, V>, value: V) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V : Comparable
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is less than a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age < 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func < <O, V>(keyPath: KeyPath<O, Optional<V>>, value: V?) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V : Comparable
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is greater than a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age > 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func > <O, V>(keyPath: KeyPath<O, Optional<V>>, value: V?) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V : Comparable
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + <=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is less than or equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age <= 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func <= <O, V>(keyPath: KeyPath<O, Optional<V>>, value: V?) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V : Comparable
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is greater than or equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age >= 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func >= <O, V>(keyPath: KeyPath<O, Optional<V>>, value: V?) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V : Comparable
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is equal to a value

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(\.master == john))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <O, D>(keyPath: KeyPath<O, D>, object: D) -> Where<O> where O : NSManagedObject, D : NSManagedObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is not equal to a value

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(\.master != john))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <O, D>(keyPath: KeyPath<O, D>, object: D) -> Where<O> where O : NSManagedObject, D : NSManagedObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ~=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by checking if a sequence contains a value of a property

    +
    let dog = CoreStore.fetchOne(From<Dog>().where([john, bob, joe] ~= \.master))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func ~= <O, D, S>(sequence: S, keyPath: KeyPath<O, D>) -> Where<O> where O : NSManagedObject, D : NSManagedObject, D == S.Element, S : Sequence
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is equal to a value

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(\.master == john))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <O, D>(keyPath: KeyPath<O, D>, objectID: NSManagedObjectID) -> Where<O> where O : NSManagedObject, D : NSManagedObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is not equal to a value

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(\.master != john))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <O, D>(keyPath: KeyPath<O, D>, objectID: NSManagedObjectID) -> Where<O> where O : NSManagedObject, D : NSManagedObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ~=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by checking if a sequence contains a value of a property

    +
    let dog = CoreStore.fetchOne(From<Dog>().where([john, bob, joe] ~= \.master))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func ~= <O, D, S>(sequence: S, keyPath: KeyPath<O, D>) -> Where<O> where O : NSManagedObject, D : NSManagedObject, S : Sequence, S.Element == NSManagedObjectID
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is equal to a value

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(\.master == john))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <O, D>(keyPath: KeyPath<O, Optional<D>>, object: D?) -> Where<O> where O : NSManagedObject, D : NSManagedObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is not equal to a value

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(\.master != john))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <O, D>(keyPath: KeyPath<O, Optional<D>>, object: D?) -> Where<O> where O : NSManagedObject, D : NSManagedObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ~=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by checking if a sequence contains a value of a property

    +
    let dog = CoreStore.fetchOne(From<Dog>().where([john, bob, joe] ~= \.master))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func ~= <O, D, S>(sequence: S, keyPath: KeyPath<O, Optional<D>>) -> Where<O> where O : NSManagedObject, D : NSManagedObject, D == S.Element, S : Sequence
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is equal to a value

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(\.master == john))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <O, D>(keyPath: KeyPath<O, Optional<D>>, objectID: NSManagedObjectID) -> Where<O> where O : NSManagedObject, D : NSManagedObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is not equal to a value

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(\.master != john))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <O, D>(keyPath: KeyPath<O, Optional<D>>, objectID: NSManagedObjectID) -> Where<O> where O : NSManagedObject, D : NSManagedObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ~=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by checking if a sequence contains a value of a property

    +
    let dog = CoreStore.fetchOne(From<Dog>().where([john, bob, joe] ~= \.master))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func ~= <O, D, S>(sequence: S, keyPath: KeyPath<O, Optional<D>>) -> Where<O> where O : NSManagedObject, D : NSManagedObject, S : Sequence, S.Element == NSManagedObjectID
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.nickname == "John"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Required<V>>, value: V) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is not equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.nickname != "John"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Required<V>>, value: V) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ~=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by checking if a sequence contains the value of a property

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(["Pluto", "Snoopy", "Scooby"] ~= \.nickname))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func ~= <O, V, S>(sequence: S, keyPath: KeyPath<O, ValueContainer<O>.Required<V>>) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType, V == S.Element, S : Sequence
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.nickname == "John"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Optional<V>>, value: V?) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is not equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.nickname != "John"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Optional<V>>, value: V?) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ~=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by checking if a sequence contains the value of a property

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(["Pluto", "Snoopy", "Scooby"] ~= \.nickname))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func ~= <O, V, S>(sequence: S, keyPath: KeyPath<O, ValueContainer<O>.Optional<V>>) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType, V == S.Element, S : Sequence
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is less than a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age < 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func < <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Required<V>>, value: V) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType, V : Comparable
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is greater than a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age > 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func > <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Required<V>>, value: V) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType, V : Comparable
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + <=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is less than or equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age <= 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func <= <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Required<V>>, value: V) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType, V : Comparable
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is greater than or equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age >= 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func >= <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Required<V>>, value: V) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType, V : Comparable
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is less than a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age < 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func < <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Optional<V>>, value: V?) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is greater than a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age > 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func > <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Optional<V>>, value: V?) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + <=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is less than or equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age <= 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func <= <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Optional<V>>, value: V?) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is greater than or equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age >= 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func >= <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Optional<V>>, value: V?) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is equal to a value

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(\.master == john))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <O, D>(keyPath: KeyPath<O, RelationshipContainer<O>.ToOne<D>>, object: D) -> Where<O> where O : CoreStoreObject, D : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is equal to a value

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(\.master == john))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <O, D>(keyPath: KeyPath<O, RelationshipContainer<O>.ToOne<D>>, object: D?) -> Where<O> where O : CoreStoreObject, D : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is not equal to a value

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(\.master != john))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <O, D>(keyPath: KeyPath<O, RelationshipContainer<O>.ToOne<D>>, object: D) -> Where<O> where O : CoreStoreObject, D : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is not equal to a value

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(\.master != john))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <O, D>(keyPath: KeyPath<O, RelationshipContainer<O>.ToOne<D>>, object: D?) -> Where<O> where O : CoreStoreObject, D : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ~=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by checking if a sequence contains a value of a property

    +
    let dog = CoreStore.fetchOne(From<Dog>().where([john, bob, joe] ~= \.master))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func ~= <O, D, S>(sequence: S, keyPath: KeyPath<O, RelationshipContainer<O>.ToOne<D>>) -> Where<O> where O : CoreStoreObject, D : CoreStoreObject, D == S.Element, S : Sequence
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Global Variables.html b/docs/Global Variables.html new file mode 100644 index 0000000..48c9de9 --- /dev/null +++ b/docs/Global Variables.html @@ -0,0 +1,817 @@ + + + + Global Variables Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Global Variables

+

The following global variables are available globally.

+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + CoreStoreErrorDomain + +
    +
    +
    +
    +
    +
    +

    The NSError error domain string for CSError.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public let CoreStoreErrorDomain: String
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols.html b/docs/Protocols.html new file mode 100644 index 0000000..b6a3c7b --- /dev/null +++ b/docs/Protocols.html @@ -0,0 +1,2785 @@ + + + + Protocols Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Protocols

+

The following protocols are available globally.

+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + CSFetchClause + +
    +
    +
    +
    +
    +
    +

    The CSFetchClause implement clauses used to configure NSFetchRequests.

    +
    +

    See also

    + FetchClause + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public protocol CSFetchClause
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CSQueryClause + +
    +
    +
    +
    +
    +
    +

    The CSQueryClause implement clauses used to configure NSFetchRequests.

    +
    +

    See also

    + QueryClause + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public protocol CSQueryClause
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CSDeleteClause + +
    +
    +
    +
    +
    +
    +

    The CSDeleteClause implement clauses used to configure NSFetchRequests.

    +
    +

    See also

    + DeleteClause + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public protocol CSDeleteClause
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CSDynamicSchema + +
    +
    +
    +
    +
    +
    +

    The CSDynamicSchema serves as the Objective-C bridging type for DynamicSchema.

    +
    +

    See also

    + DynamicSchema + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public protocol CSDynamicSchema
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CSListObserver + +
    +
    +
    +
    +
    +
    +

    Implement the CSListObserver protocol to observe changes to a list of NSManagedObjects. CSListObservers may register themselves to a CSListMonitor‘s -addListObserver: method:

    +
    CSListMonitor *monitor = [CSCoreStore 
    +    monitorListFrom:[CSFrom entityClass:[MyPersonEntity class]]
    +    fetchClauses:@[[CSOrderBy sortDescriptor:[CSSortKey withKeyPath:@"lastName" ascending:YES]]]];
    +[monitor addListObserver:self];
    +
    +
    +

    See also

    + ListObserver + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +@objc
    +public protocol CSListObserver : AnyObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CSListObjectObserver + +
    +
    +
    +
    +
    +
    +

    Implement the CSListObjectObserver protocol to observe detailed changes to a list’s object. CSListObjectObservers may register themselves to a CSListMonitor‘s -addListObjectObserver(_:) method:

    +
    CSListMonitor *monitor = [CSCoreStore
    +    monitorListFrom:[CSFrom entityClass:[MyPersonEntity class]]
    +    fetchClauses:@[[CSOrderBy sortDescriptor:[CSSortKey withKeyPath:@"lastName" ascending:YES]]]];
    +[monitor addListObjectObserver:self];
    +
    +
    +

    See also

    + ListObjectObserver + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +@objc
    +public protocol CSListObjectObserver : CSListObserver
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CSListSectionObserver + +
    +
    +
    +
    +
    +
    +

    Implement the CSListSectionObserver protocol to observe changes to a list’s section info. CSListSectionObservers may register themselves to a CSListMonitor‘s -addListSectionObserver: method:

    +
    CSListMonitor *monitor = [CSCoreStore
    +    monitorSectionedListFrom:[CSFrom entityClass:[MyPersonEntity class]]
    +    sectionBy:[CSSectionBy keyPath:@"age"]
    +    fetchClauses:@[[CSOrderBy sortDescriptor:[CSSortKey withKeyPath:@"lastName" ascending:YES]]]];
    +[monitor addListSectionObserver:self];
    +
    +
    +

    See also

    + ListSectionObserver + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +@objc
    +public protocol CSListSectionObserver : CSListObjectObserver
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CSObjectObserver + +
    +
    +
    +
    +
    +
    +

    Implement the CSObjectObserver protocol to observe changes to a single NSManagedObject instance. CSObjectObservers may register themselves to a CSObjectMonitor‘s -addObjectObserver: method:

    +
    CSObjectMonitor *monitor = [CSCoreStore monitorObject:myObject];
    +[monitor addObjectObserver:self];
    +
    +
    +

    See also

    + ObjectObserver + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +@objc
    +public protocol CSObjectObserver : AnyObject
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ + +
+
+ +
    +
  • +
    + + + + CoreDataNativeType + +
    +
    +
    +
    +
    +
    +

    Objective-C Foundation types that are natively supported by Core Data managed attributes all conform to CoreDataNativeType.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public protocol CoreDataNativeType : AnyObject, NSObjectProtocol
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    CoreStoreObjectiveCTypes are Objective-C accessible classes that represent CoreStore’s Swift types.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol CoreStoreObjectiveCType : AnyObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CoreStoreSwiftType + +
    +
    +
    +
    +
    +
    +

    CoreStoreSwiftTypes are CoreStore’s Swift types that are bridgeable to Objective-C.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol CoreStoreSwiftType
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CoreStoreLogger + +
    +
    +
    +
    +
    +
    +

    Custom loggers should implement the CoreStoreLogger protocol and pass its instance to CoreStore.logger. Calls to log(...), assert(...), and abort(...) are not tied to a specific queue/thread, so it is the implementer’s job to handle thread-safety.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol CoreStoreLogger
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Observation token for CoreStoreObject properties. Make sure to retain this instance to keep observing notifications.

    + +

    invalidate() will be called automatically when an CoreStoreObjectKeyValueObservation is deinited.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol CoreStoreObjectKeyValueObservation : AnyObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + DynamicObject + +
    +
    +
    +
    +
    +
    +

    All CoreStore’s utilities are designed around DynamicObject instances. NSManagedObject and CoreStoreObject instances all conform to DynamicObject.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol DynamicObject : AnyObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + DynamicKeyPath + +
    +
    +
    +
    +
    +
    +

    Used only for utility methods.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol DynamicKeyPath : AnyDynamicKeyPath
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + DynamicSchema + +
    +
    +
    +
    +
    +
    +

    DynamicSchema are types that provide NSManagedObjectModel instances for a single model version. CoreStore currently supports the following concrete types:

    + +
      +
    • XcodeDataModelSchema: describes models loaded from a .xcdatamodeld file.
    • +
    • UnsafeDataModelSchema: describes models loaded directly from an existing NSManagedObjectModel. It is not advisable to continue using this model as its metadata are not available to CoreStore.
    • +
    • CoreStoreSchema: describes models written for CoreStoreObject Swift class declarations.
    • +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol DynamicSchema
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Utility protocol for FetchChainBuilder. Used in fetch methods that support chained fetch builders.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol FetchChainableBuilderType
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + FetchableSource + +
    +
    +
    +
    +
    +
    +

    Encapsulates containers which manages an internal NSManagedObjectContext, such as DataStacks and transactions, that can be used for fetching objects. CoreStore provides implementations for this protocol and should be used as a read-only abstraction.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol FetchableSource : AnyObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + GroupByClause + +
    +
    +
    +
    +
    +
    +

    Abstracts the GroupBy clause for protocol utilities.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol GroupByClause
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ICloudStoreObserver + +
    +
    +
    +
    +
    +
    +

    Implement the ICloudStoreObserver protocol to observe ubiquitous storage notifications from the specified iCloud store. +Note that ICloudStoreObserver methods are only called when all the following conditions are true:

    + + + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, message: "Please see the release notes and Core Data documentation.")
    +public protocol ICloudStoreObserver : AnyObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Types supported by CoreStore as NSManagedObject and CoreStoreObject property types. +Supported default types:

    +
  • Bool
  • +
  • CGFloat
  • +
  • Data
  • +
    +

    Date

    + Date + +
    +
  • Double
  • +
  • Float
  • +
  • Int
  • +
  • Int8
  • +
  • Int16
  • +
  • Int32
  • +
  • Int64
  • +
  • NSData
  • +
  • NSDate
  • +
  • NSDecimalNumber
  • +
  • NSNumber
  • +
  • NSString
  • +
  • NSURL
  • +
  • NSUUID
  • +
  • String
  • +
  • URL
  • +
  • UUID
  • + +

    In addition, RawRepresentable types whose RawValue already implements ImportableAttributeType only need to declare conformance to ImportableAttributeType.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol ImportableAttributeType : QueryableAttributeType
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ImportableObject + +
    +
    +
    +
    +
    +
    +

    NSManagedObject and CoreStoreObject subclasses that conform to the ImportableObject protocol can be imported from a specified ImportSource. This allows transactions to create and insert instances this way:

    +
    class Person: NSManagedObject, ImportableObject {
    +    typealias ImportSource = NSDictionary
    +    // ...
    +}
    +
    +CoreStore.perform(
    +    asynchronous: { (transaction) -> Void in
    +        let json: NSDictionary = // ...
    +        let person = try transaction.importObject(
    +            Into<Person>(),
    +            source: json
    +        )
    +        // ...
    +    },
    +    completion: { (result) in
    +        // ...
    +    }
    +)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol ImportableObject : DynamicObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    NSManagedObject subclasses that conform to the ImportableUniqueObject protocol can be imported from a specified ImportSource. This allows transactions to either update existing objects or create new instances this way:

    +
    class Person: NSManagedObject, ImportableObject {
    +    typealias ImportSource = NSDictionary
    +    typealias UniqueIDType = NSString
    +    // ...
    +}
    +
    +CoreStore.perform(
    +    asynchronous: { (transaction) -> Void in
    +        let json: NSDictionary = // ...
    +        let person = try transaction.importUniqueObject(
    +            Into<Person>(),
    +            source: json
    +        )
    +        // ...
    +    },
    +    completion: { (result) in
    +        // ...
    +    }
    +)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol ImportableUniqueObject : ImportableObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ListObserver + +
    +
    +
    +
    +
    +
    +

    Implement the ListObserver protocol to observe changes to a list of NSManagedObjects. ListObservers may register themselves to a ListMonitor‘s addObserver(_:) method:

    +
    let monitor = CoreStore.monitorList(
    +    From<Person>(),
    +    OrderBy(.ascending("lastName"))
    +)
    +monitor.addObserver(self)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public protocol ListObserver : AnyObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ListObjectObserver + +
    +
    +
    +
    +
    +
    +

    Implement the ListObjectObserver protocol to observe detailed changes to a list’s object. ListObjectObservers may register themselves to a ListMonitor‘s addObserver(_:) method:

    +
    let monitor = CoreStore.monitorList(
    +    From<MyPersonEntity>(),
    +    OrderBy(.ascending("lastName"))
    +)
    +monitor.addObserver(self)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public protocol ListObjectObserver : ListObserver
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ListSectionObserver + +
    +
    +
    +
    +
    +
    +

    Implement the ListSectionObserver protocol to observe changes to a list’s section info. ListSectionObservers may register themselves to a ListMonitor‘s addObserver(_:) method:

    +
    let monitor = CoreStore.monitorSectionedList(
    +    From<MyPersonEntity>(),
    +    SectionBy("age") { "Age \($0)" },
    +    OrderBy(.ascending("lastName"))
    +)
    +monitor.addObserver(self)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public protocol ListSectionObserver : ListObjectObserver
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ObjectObserver + +
    +
    +
    +
    +
    +
    +

    Implement the ObjectObserver protocol to observe changes to a single DynamicObject instance. ObjectObservers may register themselves to a ObjectMonitor‘s addObserver(_:) method:

    +
    let monitor = CoreStore.monitorObject(object)
    +monitor.addObserver(self)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public protocol ObjectObserver : AnyObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + OrderByClause + +
    +
    +
    +
    +
    +
    +

    Abstracts the OrderBy clause for protocol utilities.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol OrderByClause
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Utility protocol for QueryChainBuilder. Used in fetch methods that support chained query builders.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol QueryChainableBuilderType
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Types supported by CoreStore for querying, especially as generic type for Select clauses. +Supported default types:

    + +
      +
    • Bool
    • +
    • CGFloat
    • +
    • Data
    • +
    • Date
    • +
    • Double
    • +
    • Float
    • +
    • Int
    • +
    • Int8
    • +
    • Int16
    • +
    • Int32
    • +
    • Int64
    • +
    • NSData
    • +
    • NSDate
    • +
    • NSDecimalNumber
    • +
    • NSManagedObjectID
    • +
    • NSNull
    • +
    • NSNumber
    • +
    • NSString
    • +
    • NSURL
    • +
    • NSUUID
    • +
    • String
    • +
    • URL
    • +
    • UUID
    • +
    + +

    In addition, RawRepresentable types whose RawValue already implements QueryableAttributeType only need to declare conformance to QueryableAttributeType.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol QueryableAttributeType : SelectResultType, Hashable
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + QueryableSource + +
    +
    +
    +
    +
    +
    +

    Encapsulates containers which manages an internal NSManagedObjectContext, such as DataStacks and transactions, that can be used for querying values. CoreStore provides implementations for this protocol and should be used as a read-only abstraction.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol QueryableSource : AnyObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + SchemaMappingProvider + +
    +
    +
    +
    +
    +
    +

    The SchemaMappingProvider provides migration mapping information between two DynamicSchema versions.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol SchemaMappingProvider
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + SelectResultType + +
    +
    +
    +
    +
    +
    +

    The SelectResultType protocol is implemented by return types supported by the Select clause.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol SelectResultType
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    The SelectAttributesResultType protocol is implemented by return types supported by the queryAttributes(...) methods.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol SelectAttributesResultType : SelectResultType
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + SelectClause + +
    +
    +
    +
    +
    +
    +

    Abstracts the Select clause for protocol utilities.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol SelectClause
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + StorageInterface + +
    +
    +
    +
    +
    +
    +

    The StorageInterface represents the data store managed (or to be managed) by the DataStack. When added to the DataStack, the StorageInterface serves as the interface for the NSPersistentStore. This may be a database file, an in-memory store, etc.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol StorageInterface : AnyObject
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ + +
+
+ +
    +
  • +
    + + + + FetchClause + +
    +
    +
    +
    +
    +
    +

    The FetchClause implement clauses used to configure NSFetchRequests.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol FetchClause
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + QueryClause + +
    +
    +
    +
    +
    +
    +

    The QueryClause implement clauses used to configure NSFetchRequests.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol QueryClause : FetchClause
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + DeleteClause + +
    +
    +
    +
    +
    +
    +

    The DeleteClause implement clauses used to configure NSFetchRequests.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol DeleteClause : FetchClause
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ + +
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/AnyWhereClause.html b/docs/Protocols/AnyWhereClause.html new file mode 100644 index 0000000..18ef41c --- /dev/null +++ b/docs/Protocols/AnyWhereClause.html @@ -0,0 +1,861 @@ + + + + AnyWhereClause Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

AnyWhereClause

+
+
+
public protocol AnyWhereClause : DeleteClause, QueryClause
+ +
+
+

Type-erased Where clause for protocol utilities.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + predicate + +
    +
    +
    +
    +
    +
    +

    The NSPredicate for the fetch or query

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var predicate: NSPredicate { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause with an NSPredicate

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    init(_ predicate: NSPredicate)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + predicate + + +
    +

    the NSPredicate for the fetch or query

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/CSDynamicSchema.html b/docs/Protocols/CSDynamicSchema.html new file mode 100644 index 0000000..d505435 --- /dev/null +++ b/docs/Protocols/CSDynamicSchema.html @@ -0,0 +1,850 @@ + + + + CSDynamicSchema Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSDynamicSchema

+
+
+
@objc
+public protocol CSDynamicSchema
+ +
+
+

The CSDynamicSchema serves as the Objective-C bridging type for DynamicSchema.

+
+

See also

+ DynamicSchema + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + modelVersion + +
    +
    +
    +
    +
    +
    +

    The version string for this model schema.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +var modelVersion: ModelVersion { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + rawModel() + +
    +
    +
    +
    +
    +
    +

    Do not call this directly. The NSManagedObjectModel for this schema may be created lazily and using this method directly may affect the integrity of the model.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +func rawModel() -> NSManagedObjectModel
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/CSListObjectObserver.html b/docs/Protocols/CSListObjectObserver.html new file mode 100644 index 0000000..2b87092 --- /dev/null +++ b/docs/Protocols/CSListObjectObserver.html @@ -0,0 +1,1096 @@ + + + + CSListObjectObserver Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSListObjectObserver

+
+
+
@available(OSX 10.12, *)
+@objc
+public protocol CSListObjectObserver : CSListObserver
+ +
+
+

Implement the CSListObjectObserver protocol to observe detailed changes to a list’s object. CSListObjectObservers may register themselves to a CSListMonitor‘s -addListObjectObserver(_:) method:

+
CSListMonitor *monitor = [CSCoreStore
+    monitorListFrom:[CSFrom entityClass:[MyPersonEntity class]]
+    fetchClauses:@[[CSOrderBy sortDescriptor:[CSSortKey withKeyPath:@"lastName" ascending:YES]]]];
+[monitor addListObjectObserver:self];
+
+
+

See also

+ ListObjectObserver + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Notifies that an object was inserted to the specified NSIndexPath in the list

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +optional func listMonitor(_ monitor: CSListMonitor, didInsertObject object: Any, toIndexPath indexPath: IndexPath)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + monitor + + +
    +

    the CSListMonitor monitoring the list being observed

    +
    +
    + + object + + +
    +

    the entity type for the inserted object

    +
    +
    + + indexPath + + +
    +

    the new NSIndexPath for the inserted object

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Notifies that an object was deleted from the specified NSIndexPath in the list

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +optional func listMonitor(_ monitor: CSListMonitor, didDeleteObject object: Any, fromIndexPath indexPath: IndexPath)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + monitor + + +
    +

    the CSListMonitor monitoring the list being observed

    +
    +
    + + object + + +
    +

    the entity type for the deleted object

    +
    +
    + + indexPath + + +
    +

    the NSIndexPath for the deleted object

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Notifies that an object at the specified NSIndexPath was updated

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +optional func listMonitor(_ monitor: CSListMonitor, didUpdateObject object: Any, atIndexPath indexPath: IndexPath)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + monitor + + +
    +

    the CSListMonitor monitoring the list being observed

    +
    +
    + + object + + +
    +

    the entity type for the updated object

    +
    +
    + + indexPath + + +
    +

    the NSIndexPath for the updated object

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Notifies that an object’s index changed

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +optional func listMonitor(_ monitor: CSListMonitor, didMoveObject object: Any, fromIndexPath: IndexPath, toIndexPath: IndexPath)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + monitor + + +
    +

    the CSListMonitor monitoring the list being observed

    +
    +
    + + object + + +
    +

    the entity type for the moved object

    +
    +
    + + fromIndexPath + + +
    +

    the previous NSIndexPath for the moved object

    +
    +
    + + toIndexPath + + +
    +

    the new NSIndexPath for the moved object

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/CSListObserver.html b/docs/Protocols/CSListObserver.html new file mode 100644 index 0000000..1d54130 --- /dev/null +++ b/docs/Protocols/CSListObserver.html @@ -0,0 +1,988 @@ + + + + CSListObserver Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSListObserver

+
+
+
@available(OSX 10.12, *)
+@objc
+public protocol CSListObserver : AnyObject
+ +
+
+

Implement the CSListObserver protocol to observe changes to a list of NSManagedObjects. CSListObservers may register themselves to a CSListMonitor‘s -addListObserver: method:

+
CSListMonitor *monitor = [CSCoreStore 
+    monitorListFrom:[CSFrom entityClass:[MyPersonEntity class]]
+    fetchClauses:@[[CSOrderBy sortDescriptor:[CSSortKey withKeyPath:@"lastName" ascending:YES]]]];
+[monitor addListObserver:self];
+
+
+

See also

+ ListObserver + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Handles processing just before a change to the observed list occurs

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +optional func listMonitorWillChange(_ monitor: CSListMonitor)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + monitor + + +
    +

    the CSListMonitor monitoring the list being observed

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Handles processing right after a change to the observed list occurs

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +optional func listMonitorDidChange(_ monitor: CSListMonitor)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + monitor + + +
    +

    the CSListMonitor monitoring the object being observed

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    This method is broadcast from within the CSListMonitor‘s -refetchWithFetchClauses: method to let observers prepare for the internal NSFetchedResultsController’s pending change to its predicate, sort descriptors, etc. Note that the actual refetch will happen after the NSFetchedResultsController’s last -controllerDidChangeContent: notification completes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +optional func listMonitorWillRefetch(_ monitor: CSListMonitor)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + monitor + + +
    +

    the CSListMonitor monitoring the object being observed

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    After the CSListMonitor‘s -refetchWithFetchClauses: method is called, this method is broadcast after the NSFetchedResultsController’s last -controllerDidChangeContent: notification completes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +optional func listMonitorDidRefetch(_ monitor: CSListMonitor)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + monitor + + +
    +

    the CSListMonitor monitoring the object being observed

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/CSListSectionObserver.html b/docs/Protocols/CSListSectionObserver.html new file mode 100644 index 0000000..33904f8 --- /dev/null +++ b/docs/Protocols/CSListSectionObserver.html @@ -0,0 +1,943 @@ + + + + CSListSectionObserver Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSListSectionObserver

+
+
+
@available(OSX 10.12, *)
+@objc
+public protocol CSListSectionObserver : CSListObjectObserver
+ +
+
+

Implement the CSListSectionObserver protocol to observe changes to a list’s section info. CSListSectionObservers may register themselves to a CSListMonitor‘s -addListSectionObserver: method:

+
CSListMonitor *monitor = [CSCoreStore
+    monitorSectionedListFrom:[CSFrom entityClass:[MyPersonEntity class]]
+    sectionBy:[CSSectionBy keyPath:@"age"]
+    fetchClauses:@[[CSOrderBy sortDescriptor:[CSSortKey withKeyPath:@"lastName" ascending:YES]]]];
+[monitor addListSectionObserver:self];
+
+
+

See also

+ ListSectionObserver + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Notifies that a section was inserted at the specified index

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +optional func listMonitor(_ monitor: CSListMonitor, didInsertSection sectionInfo: NSFetchedResultsSectionInfo, toSectionIndex sectionIndex: Int)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + monitor + + +
    +

    the CSListMonitor monitoring the list being observed

    +
    +
    + + sectionInfo + + +
    +

    the NSFetchedResultsSectionInfo for the inserted section

    +
    +
    + + sectionIndex + + +
    +

    the new section index for the new section

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Notifies that a section was inserted at the specified index

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +optional func listMonitor(_ monitor: CSListMonitor, didDeleteSection sectionInfo: NSFetchedResultsSectionInfo, fromSectionIndex sectionIndex: Int)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + monitor + + +
    +

    the CSListMonitor monitoring the list being observed

    +
    +
    + + sectionInfo + + +
    +

    the NSFetchedResultsSectionInfo for the deleted section

    +
    +
    + + sectionIndex + + +
    +

    the previous section index for the deleted section

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/CSLocalStorage.html b/docs/Protocols/CSLocalStorage.html new file mode 100644 index 0000000..e4cd93e --- /dev/null +++ b/docs/Protocols/CSLocalStorage.html @@ -0,0 +1,906 @@ + + + + CSLocalStorage Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSLocalStorage

+
+
+
@objc
+public protocol CSLocalStorage : CSStorageInterface
+ +
+
+

The CSLocalStorage serves as the Objective-C bridging type for LocalStorage.

+
+

See also

+ LocalStorage + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + fileURL + +
    +
    +
    +
    +
    +
    +

    The NSURL that points to the store file

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +var fileURL: URL { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    An array of SchemaMappingProviders that provides the complete mapping models for custom migrations. This is currently only supported for Swift code.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +var migrationMappingProviders: [Any] { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + localStorageOptions + +
    +
    +
    +
    +
    +
    +

    Options that tell the CSDataStack how to setup the persistent store

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +var localStorageOptions: Int { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Called by the CSDataStack to perform actual deletion of the store file from disk. Do not call directly! The sourceModel argument is a hint for the existing store’s model version. Implementers can use the sourceModel to perform necessary store operations. (SQLite stores for example, can convert WAL journaling mode to DELETE before deleting)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +func cs_eraseStorageAndWait(metadata: NSDictionary, soureModelHint: NSManagedObjectModel?, error: NSErrorPointer) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/CSObjectObserver.html b/docs/Protocols/CSObjectObserver.html new file mode 100644 index 0000000..283928a --- /dev/null +++ b/docs/Protocols/CSObjectObserver.html @@ -0,0 +1,987 @@ + + + + CSObjectObserver Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSObjectObserver

+
+
+
@available(OSX 10.12, *)
+@objc
+public protocol CSObjectObserver : AnyObject
+ +
+
+

Implement the CSObjectObserver protocol to observe changes to a single NSManagedObject instance. CSObjectObservers may register themselves to a CSObjectMonitor‘s -addObjectObserver: method:

+
CSObjectMonitor *monitor = [CSCoreStore monitorObject:myObject];
+[monitor addObjectObserver:self];
+
+
+

See also

+ ObjectObserver + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Handles processing just before a change to the observed object occurs

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +optional func objectMonitor(_ monitor: CSObjectMonitor, willUpdateObject object: Any)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + monitor + + +
    +

    the CSObjectMonitor monitoring the object being observed

    +
    +
    + + object + + +
    +

    the NSManagedObject instance being observed

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Handles processing right after a change to the observed object occurs

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +optional func objectMonitor(_ monitor: CSObjectMonitor, didUpdateObject object: Any, changedPersistentKeys: Set<String>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + monitor + + +
    +

    the CSObjectMonitor monitoring the object being observed

    +
    +
    + + object + + +
    +

    the NSManagedObject instance being observed

    +
    +
    + + changedPersistentKeys + + +
    +

    an NSSet of key paths for the attributes that were changed. Note that changedPersistentKeys only contains keys for attributes/relationships present in the persistent store, thus transient properties will not be reported.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Handles processing right after object is deleted

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +optional func objectMonitor(_ monitor: CSObjectMonitor, didDeleteObject object: Any)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + monitor + + +
    +

    the CSObjectMonitor monitoring the object being observed

    +
    +
    + + object + + +
    +

    the NSManagedObject instance being observed

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/CSStorageInterface.html b/docs/Protocols/CSStorageInterface.html new file mode 100644 index 0000000..1814816 --- /dev/null +++ b/docs/Protocols/CSStorageInterface.html @@ -0,0 +1,878 @@ + + + + CSStorageInterface Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSStorageInterface

+
+
+
@objc
+public protocol CSStorageInterface
+ +
+
+

The CSStorageInterface serves as the Objective-C bridging type for StorageInterface.

+
+

See also

+ StorageInterface + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + storeType + +
    +
    +
    +
    +
    +
    +

    The string identifier for the NSPersistentStore‘s type property. This is the same string CoreStore will use to create the NSPersistentStore from the NSPersistentStoreCoordinator’s addPersistentStoreWithType(...) method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +static var storeType: String { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    +

    The configuration name in the model file

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +var configuration: ModelConfiguration { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + storeOptions + +
    +
    +
    +
    +
    +
    +

    The options dictionary for the NSPersistentStore

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +var storeOptions: [AnyHashable : Any]? { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/CloudStorage.html b/docs/Protocols/CloudStorage.html new file mode 100644 index 0000000..3502291 --- /dev/null +++ b/docs/Protocols/CloudStorage.html @@ -0,0 +1,896 @@ + + + + CloudStorage Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CloudStorage

+
+
+
public protocol CloudStorage : StorageInterface
+ +
+
+

The CloudStorage represents StorageInterfaces that are synchronized from a cloud-based store.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + cacheFileURL + +
    +
    +
    +
    +
    +
    +

    The NSURL that points to the store file

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var cacheFileURL: URL { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cloudStorageOptions + +
    +
    +
    +
    +
    +
    +

    Options that tell the DataStack how to setup the persistent store

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var cloudStorageOptions: CloudStorageOptions { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The options dictionary for the specified CloudStorageOptions

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func dictionary(forOptions options: CloudStorageOptions) -> [AnyHashable : Any]?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Called by the DataStack to perform actual deletion of the store file from disk. Do not call directly! The sourceModel argument is a hint for the existing store’s model version. Implementers can use the sourceModel to perform necessary store operations. (Cloud stores for example, can set the NSPersistentStoreRemoveUbiquitousMetadataOption option before deleting)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func cs_eraseStorageAndWait(soureModel: NSManagedObjectModel) throws
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/CoreStoreLogger.html b/docs/Protocols/CoreStoreLogger.html new file mode 100644 index 0000000..dcd2243 --- /dev/null +++ b/docs/Protocols/CoreStoreLogger.html @@ -0,0 +1,1164 @@ + + + + CoreStoreLogger Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CoreStoreLogger

+
+
+
public protocol CoreStoreLogger
+ +
+
+

Custom loggers should implement the CoreStoreLogger protocol and pass its instance to CoreStore.logger. Calls to log(...), assert(...), and abort(...) are not tied to a specific queue/thread, so it is the implementer’s job to handle thread-safety.

+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Handles log messages sent by the CoreStore framework.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func log(level: LogLevel, message: String, fileName: StaticString, lineNumber: Int, functionName: StaticString)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + +
    + + level + + +
    +

    the severity of the log message

    +
    +
    + + message + + +
    +

    the log message

    +
    +
    + + fileName + + +
    +

    the source file name

    +
    +
    + + lineNumber + + +
    +

    the source line number

    +
    +
    + + functionName + + +
    +

    the source function name

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Handles errors sent by the CoreStore framework.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func log(error: CoreStoreError, message: String, fileName: StaticString, lineNumber: Int, functionName: StaticString)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + +
    + + error + + +
    +

    the error

    +
    +
    + + message + + +
    +

    the error message

    +
    +
    + + fileName + + +
    +

    the source file name

    +
    +
    + + lineNumber + + +
    +

    the source line number

    +
    +
    + + functionName + + +
    +

    the source function name

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Handles assertions made throughout the CoreStore framework.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func assert(_ condition: @autoclosure () -> Bool, message: @autoclosure () -> String, fileName: StaticString, lineNumber: Int, functionName: StaticString)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + +
    + + condition + + +
    +

    the assertion condition

    +
    +
    + + message + + +
    +

    the assertion message

    +
    +
    + + fileName + + +
    +

    the source file name

    +
    +
    + + lineNumber + + +
    +

    the source line number

    +
    +
    + + functionName + + +
    +

    the source function name

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + abort(_:fileName:lineNumber:functionName:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Handles fatal errors made throughout the CoreStore framework. The app wil terminate after this method is called.

    +
    +

    Important

    +

    Implementers may guarantee that the function doesn’t return, either by calling another Never function such as fatalError() or abort(), or by raising an exception. If the implementation does not terminate the app, CoreStore will call an internal fatalError() to do so.

    + +
    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func abort(_ message: String, fileName: StaticString, lineNumber: Int, functionName: StaticString)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + message + + +
    +

    the fatal error message

    +
    +
    + + fileName + + +
    +

    the source file name

    +
    +
    + + lineNumber + + +
    +

    the source line number

    +
    +
    + + functionName + + +
    +

    the source function name

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/CoreStoreObjectKeyValueObservation.html b/docs/Protocols/CoreStoreObjectKeyValueObservation.html new file mode 100644 index 0000000..86ec013 --- /dev/null +++ b/docs/Protocols/CoreStoreObjectKeyValueObservation.html @@ -0,0 +1,817 @@ + + + + CoreStoreObjectKeyValueObservation Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CoreStoreObjectKeyValueObservation

+
+
+
public protocol CoreStoreObjectKeyValueObservation : AnyObject
+ +
+
+

Observation token for CoreStoreObject properties. Make sure to retain this instance to keep observing notifications.

+ +

invalidate() will be called automatically when an CoreStoreObjectKeyValueObservation is deinited.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + invalidate() + +
    +
    +
    +
    +
    +
    +

    invalidate() will be called automatically when an CoreStoreObjectKeyValueObservation is deinited.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func invalidate()
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/CoreStoreObjectiveCType.html b/docs/Protocols/CoreStoreObjectiveCType.html new file mode 100644 index 0000000..f039fa7 --- /dev/null +++ b/docs/Protocols/CoreStoreObjectiveCType.html @@ -0,0 +1,869 @@ + + + + CoreStoreObjectiveCType Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CoreStoreObjectiveCType

+
+
+
public protocol CoreStoreObjectiveCType : AnyObject
+ +
+
+

CoreStoreObjectiveCTypes are Objective-C accessible classes that represent CoreStore’s Swift types.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + SwiftType + +
    +
    +
    +
    +
    +
    +

    The corresponding Swift type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype SwiftType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + bridgeToSwift + +
    +
    +
    +
    +
    +
    +

    The bridged Swift instance

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var bridgeToSwift: SwiftType { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes this instance with the Swift instance to bridge from

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    init(_ swiftValue: SwiftType)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/CoreStoreSwiftType.html b/docs/Protocols/CoreStoreSwiftType.html new file mode 100644 index 0000000..18b5cc1 --- /dev/null +++ b/docs/Protocols/CoreStoreSwiftType.html @@ -0,0 +1,842 @@ + + + + CoreStoreSwiftType Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CoreStoreSwiftType

+
+
+
public protocol CoreStoreSwiftType
+ +
+
+

CoreStoreSwiftTypes are CoreStore’s Swift types that are bridgeable to Objective-C.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + ObjectiveCType + +
    +
    +
    +
    +
    +
    +

    The corresponding Objective-C type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype ObjectiveCType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + bridgeToObjectiveC + +
    +
    +
    +
    +
    +
    +

    The bridged Objective-C instance

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var bridgeToObjectiveC: ObjectiveCType { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/DynamicKeyPath.html b/docs/Protocols/DynamicKeyPath.html new file mode 100644 index 0000000..2cbd840 --- /dev/null +++ b/docs/Protocols/DynamicKeyPath.html @@ -0,0 +1,842 @@ + + + + DynamicKeyPath Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

DynamicKeyPath

+
+
+
public protocol DynamicKeyPath : AnyDynamicKeyPath
+ +
+
+

Used only for utility methods.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    +

    The DynamicObject type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype ObjectType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ValueType + +
    +
    +
    +
    +
    +
    +

    The Value type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype ValueType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/DynamicObject.html b/docs/Protocols/DynamicObject.html new file mode 100644 index 0000000..a277383 --- /dev/null +++ b/docs/Protocols/DynamicObject.html @@ -0,0 +1,1121 @@ + + + + DynamicObject Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

DynamicObject

+
+
+
public protocol DynamicObject : AnyObject
+ +
+
+

All CoreStore’s utilities are designed around DynamicObject instances. NSManagedObject and CoreStoreObject instances all conform to DynamicObject.

+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Used internally by CoreStore. Do not call directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func cs_forceCreate(entityDescription: NSEntityDescription, into context: NSManagedObjectContext, assignTo store: NSPersistentStore) -> Self
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_fromRaw(object:) + +
    +
    +
    +
    +
    +
    +

    Used internally by CoreStore. Do not call directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func cs_fromRaw(object: NSManagedObject) -> Self
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_matches(object:) + +
    +
    +
    +
    +
    +
    +

    Used internally by CoreStore. Do not call directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func cs_matches(object: NSManagedObject) -> Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_id() + +
    +
    +
    +
    +
    +
    +

    Used internally by CoreStore. Do not call directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func cs_id() -> NSManagedObjectID
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_toRaw() + +
    +
    +
    +
    +
    +
    +

    Used internally by CoreStore. Do not call directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func cs_toRaw() -> NSManagedObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + partialObject() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the PartialObject instance for the object, which acts as a fast, type-safe KVC interface for CoreStoreObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func partialObject() -> PartialObject<Self>
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + Relationship + + + Extension method + +
    +
    +
    +
    +
    +
    +

    The containing type for relationships. Relationships can be any CoreStoreObject subclass.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyUnordered<Dog>("pets", inverse: { $0.master })
    +}
    +
    +
    +

    Important

    + Relationship properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Relationship = RelationshipContainer<Self>
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + Transformable + + + Extension method + +
    +
    +
    +
    +
    +
    +

    The containing type for transformable properties. Transformable properties support types that conforms to NSCoding & NSCopying.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let nickname = Value.Optional<String>("nickname")
    +    let color = Transformable.Optional<UIColor>("color")
    +}
    +
    +
    +

    Important

    + Transformable properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Transformable = TransformableContainer<Self>
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + Value + + + Extension method + +
    +
    +
    +
    +
    +
    +

    The containing type for value propertiess. Value properties support any type that conforms to ImportableAttributeType.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let nickname = Value.Optional<String>("nickname")
    +    let color = Transformable.Optional<UIColor>("color")
    +}
    +
    +
    +

    Important

    + Value properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Value = ValueContainer<Self>
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/DynamicSchema.html b/docs/Protocols/DynamicSchema.html new file mode 100644 index 0000000..07fae6b --- /dev/null +++ b/docs/Protocols/DynamicSchema.html @@ -0,0 +1,898 @@ + + + + DynamicSchema Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

DynamicSchema

+
+
+
public protocol DynamicSchema
+ +
+
+

DynamicSchema are types that provide NSManagedObjectModel instances for a single model version. CoreStore currently supports the following concrete types:

+ +
    +
  • XcodeDataModelSchema: describes models loaded from a .xcdatamodeld file.
  • +
  • UnsafeDataModelSchema: describes models loaded directly from an existing NSManagedObjectModel. It is not advisable to continue using this model as its metadata are not available to CoreStore.
  • +
  • CoreStoreSchema: describes models written for CoreStoreObject Swift class declarations.
  • +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + modelVersion + +
    +
    +
    +
    +
    +
    +

    The version string for this model schema.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var modelVersion: ModelVersion { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + rawModel() + +
    +
    +
    +
    +
    +
    +

    Do not call this directly. The NSManagedObjectModel for this schema may be created lazily and using this method directly may affect the integrity of the model.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func rawModel() -> NSManagedObjectModel
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + printCoreStoreSchema() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Prints the DynamicSchema as their corresponding CoreStoreObject Swift declarations. This is useful for converting current XcodeDataModelSchema-based models into the new CoreStoreSchema framework. Additional adjustments may need to be done to the generated source code; for example: Transformable concrete types need to be provided, as well as default values.

    +
    +

    Important

    + After transitioning to the new CoreStoreSchema framework, it is recommended to add the new schema as a new version that the existing versions’ XcodeDataModelSchema can migrate to. It is discouraged to load existing SQLite files created with XcodeDataModelSchema directly into a CoreStoreSchema. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func printCoreStoreSchema() -> String
    + +
    +
    +
    +

    Return Value

    +

    a string that represents the source code for the DynamicSchema as their corresponding CoreStoreObject Swift declarations.

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/FetchChainableBuilderType.html b/docs/Protocols/FetchChainableBuilderType.html new file mode 100644 index 0000000..27f07f5 --- /dev/null +++ b/docs/Protocols/FetchChainableBuilderType.html @@ -0,0 +1,869 @@ + + + + FetchChainableBuilderType Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

FetchChainableBuilderType

+
+
+
public protocol FetchChainableBuilderType
+ +
+
+

Utility protocol for FetchChainBuilder. Used in fetch methods that support chained fetch builders.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    +

    The DynamicObject type for the fetch

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype ObjectType : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + from + +
    +
    +
    +
    +
    +
    +

    The From clause specifies the source entity and source persistent store for the fetch

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var from: From<ObjectType> { get set }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchClauses + +
    +
    +
    +
    +
    +
    +

    The FetchClauses to be used for the fetch

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var fetchClauses: [FetchClause] { get set }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/FetchableSource.html b/docs/Protocols/FetchableSource.html new file mode 100644 index 0000000..ee19f3e --- /dev/null +++ b/docs/Protocols/FetchableSource.html @@ -0,0 +1,1915 @@ + + + + FetchableSource Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

FetchableSource

+
+
+
public protocol FetchableSource : AnyObject
+ +
+
+

Encapsulates containers which manages an internal NSManagedObjectContext, such as DataStacks and transactions, that can be used for fetching objects. CoreStore provides implementations for this protocol and should be used as a read-only abstraction.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the DynamicObject instance in the FetchableSource‘s context from a reference created from another managed object context.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchExisting<D>(_ object: D) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    a reference to the object created/fetched outside the FetchableSource‘s context

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject instance if the object exists in the FetchableSource‘s context, or nil if not found.

    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the DynamicObject instance in the FetchableSource‘s context from an NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchExisting<D>(_ objectID: NSManagedObjectID) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objectID + + +
    +

    the NSManagedObjectID for the object

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject instance if the object exists in the FetchableSource, or nil if not found.

    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the DynamicObject instances in the FetchableSource‘s context from references created from another managed object context.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchExisting<D, S>(_ objects: S) -> [D] where D : DynamicObject, D == S.Element, S : Sequence
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objects + + +
    +

    an array of DynamicObjects created/fetched outside the FetchableSource‘s context

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject array for objects that exists in the FetchableSource

    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the DynamicObject instances in the FetchableSource‘s context from a list of NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchExisting<D, S>(_ objectIDs: S) -> [D] where D : DynamicObject, S : Sequence, S.Element == NSManagedObjectID
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objectIDs + + +
    +

    the NSManagedObjectID array for the objects

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject array for objects that exists in the FetchableSource‘s context

    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the first DynamicObject instance that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchOne<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the first DynamicObject instance that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the first DynamicObject instance that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchOne<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the first DynamicObject instance that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the first DynamicObject instance that satisfies the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let youngestTeen = source.fetchOne(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchOne<B>(_ clauseChain: B) -> B.ObjectType? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the first DynamicObject instance that satisfies the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches all DynamicObject instances that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchAll<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> [D]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    all DynamicObject instances that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches all DynamicObject instances that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchAll<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> [D]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    all DynamicObject instances that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches all DynamicObject instances that satisfy the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let people = source.fetchAll(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchAll<B>(_ clauseChain: B) -> [B.ObjectType]? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    all DynamicObject instances that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the number of DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchCount<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> Int? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the number DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the number of DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchCount<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> Int? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the number DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the number of DynamicObjects that satisfy the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let numberOfAdults = source.fetchCount(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchCount<B>(_ clauseChain: B) -> Int? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the number DynamicObjects that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> NSManagedObjectID? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> NSManagedObjectID? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let youngestTeenID = source.fetchObjectID(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchObjectID<B>(_ clauseChain: B) -> NSManagedObjectID? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> [NSManagedObjectID]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> [NSManagedObjectID]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let idsOfAdults = source.fetchObjectIDs(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchObjectIDs<B>(_ clauseChain: B) -> [NSManagedObjectID]? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + unsafeContext() + +
    +
    +
    +
    +
    +
    +

    The internal NSManagedObjectContext managed by this FetchableSource. Using this context directly should typically be avoided, and is provided by CoreStore only for extremely specialized cases.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func unsafeContext() -> NSManagedObjectContext
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/GroupByClause.html b/docs/Protocols/GroupByClause.html new file mode 100644 index 0000000..725f199 --- /dev/null +++ b/docs/Protocols/GroupByClause.html @@ -0,0 +1,842 @@ + + + + GroupByClause Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

GroupByClause

+
+
+
public protocol GroupByClause
+ +
+
+

Abstracts the GroupBy clause for protocol utilities.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    +

    The DynamicObject type associated with the clause

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype ObjectType : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + keyPaths + +
    +
    +
    +
    +
    +
    +

    The list of key path strings to group results with

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var keyPaths: [KeyPathString] { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/ICloudStoreObserver.html b/docs/Protocols/ICloudStoreObserver.html new file mode 100644 index 0000000..53afa24 --- /dev/null +++ b/docs/Protocols/ICloudStoreObserver.html @@ -0,0 +1,1316 @@ + + + + ICloudStoreObserver Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ICloudStoreObserver

+
+
+
@available(*, deprecated, message: "Please see the release notes and Core Data documentation.")
+public protocol ICloudStoreObserver : AnyObject
+ +
+
+

Implement the ICloudStoreObserver protocol to observe ubiquitous storage notifications from the specified iCloud store. +Note that ICloudStoreObserver methods are only called when all the following conditions are true:

+ + + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Notifies that the initial ubiquitous store import will complete

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func iCloudStoreWillFinishUbiquitousStoreInitialImport(storage: ICloudStore, dataStack: DataStack)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the ICloudStore instance being observed

    +
    +
    + + dataStack + + +
    +

    the DataStack that manages the peristent store

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Notifies that the initial ubiquitous store import completed

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func iCloudStoreDidFinishUbiquitousStoreInitialImport(storage: ICloudStore, dataStack: DataStack)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the ICloudStore instance being observed

    +
    +
    + + dataStack + + +
    +

    the DataStack that manages the peristent store

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + iCloudStoreWillAddAccount(storage:dataStack:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies that an iCloud account will be added to the coordinator

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func iCloudStoreWillAddAccount(storage: ICloudStore, dataStack: DataStack)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the ICloudStore instance being observed

    +
    +
    + + dataStack + + +
    +

    the DataStack that manages the peristent store

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + iCloudStoreDidAddAccount(storage:dataStack:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies that an iCloud account was added to the coordinator

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func iCloudStoreDidAddAccount(storage: ICloudStore, dataStack: DataStack)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the ICloudStore instance being observed

    +
    +
    + + dataStack + + +
    +

    the DataStack that manages the peristent store

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + iCloudStoreWillRemoveAccount(storage:dataStack:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies that an iCloud account will be removed from the coordinator

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func iCloudStoreWillRemoveAccount(storage: ICloudStore, dataStack: DataStack)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the ICloudStore instance being observed

    +
    +
    + + dataStack + + +
    +

    the DataStack that manages the peristent store

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + iCloudStoreDidRemoveAccount(storage:dataStack:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies that an iCloud account was removed from the coordinator

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func iCloudStoreDidRemoveAccount(storage: ICloudStore, dataStack: DataStack)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the ICloudStore instance being observed

    +
    +
    + + dataStack + + +
    +

    the DataStack that manages the peristent store

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + iCloudStoreWillRemoveContent(storage:dataStack:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies that iCloud contents will be deleted

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func iCloudStoreWillRemoveContent(storage: ICloudStore, dataStack: DataStack)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the ICloudStore instance being observed

    +
    +
    + + dataStack + + +
    +

    the DataStack that manages the peristent store

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + iCloudStoreDidRemoveContent(storage:dataStack:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies that iCloud contents were deleted

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func iCloudStoreDidRemoveContent(storage: ICloudStore, dataStack: DataStack)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the ICloudStore instance being observed

    +
    +
    + + dataStack + + +
    +

    the DataStack that manages the peristent store

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/ImportableObject.html b/docs/Protocols/ImportableObject.html new file mode 100644 index 0000000..a848919 --- /dev/null +++ b/docs/Protocols/ImportableObject.html @@ -0,0 +1,961 @@ + + + + ImportableObject Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ImportableObject

+
+
+
public protocol ImportableObject : DynamicObject
+ +
+
+

NSManagedObject and CoreStoreObject subclasses that conform to the ImportableObject protocol can be imported from a specified ImportSource. This allows transactions to create and insert instances this way:

+
class Person: NSManagedObject, ImportableObject {
+    typealias ImportSource = NSDictionary
+    // ...
+}
+
+CoreStore.perform(
+    asynchronous: { (transaction) -> Void in
+        let json: NSDictionary = // ...
+        let person = try transaction.importObject(
+            Into<Person>(),
+            source: json
+        )
+        // ...
+    },
+    completion: { (result) in
+        // ...
+    }
+)
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + ImportSource + +
    +
    +
    +
    +
    +
    +

    The data type for the import source. This is most commonly an json type, NSDictionary, or another external source such as NSUserDefaults.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype ImportSource
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + shouldInsert(from:in:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Return true if an object should be created from source. Return false to ignore and skip source. The default implementation returns true.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func shouldInsert(from source: ImportSource, in transaction: BaseDataTransaction) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + source + + +
    +

    the object to import from

    +
    +
    + + transaction + + +
    +

    the transaction that invoked the import. Use the transaction to fetch or create related objects if needed.

    +
    +
    +
    +
    +

    Return Value

    +

    true if an object should be created from source. Return false to ignore.

    +
    +
    +
    +
  • +
  • +
    + + + + didInsert(from:in:) + +
    +
    +
    +
    +
    +
    +

    Implements the actual importing of data from source. Implementers should pull values from source and assign them to the receiver’s attributes. Note that throwing from this method will cause subsequent imports that are part of the same importObjects(:sourceArray:) call to be cancelled.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func didInsert(from source: ImportSource, in transaction: BaseDataTransaction) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + source + + +
    +

    the object to import from

    +
    +
    + + transaction + + +
    +

    the transaction that invoked the import. Use the transaction to fetch or create related objects if needed.

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/ImportableUniqueObject.html b/docs/Protocols/ImportableUniqueObject.html new file mode 100644 index 0000000..02ff3b7 --- /dev/null +++ b/docs/Protocols/ImportableUniqueObject.html @@ -0,0 +1,1210 @@ + + + + ImportableUniqueObject Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ImportableUniqueObject

+
+
+
public protocol ImportableUniqueObject : ImportableObject
+ +
+
+

NSManagedObject subclasses that conform to the ImportableUniqueObject protocol can be imported from a specified ImportSource. This allows transactions to either update existing objects or create new instances this way:

+
class Person: NSManagedObject, ImportableObject {
+    typealias ImportSource = NSDictionary
+    typealias UniqueIDType = NSString
+    // ...
+}
+
+CoreStore.perform(
+    asynchronous: { (transaction) -> Void in
+        let json: NSDictionary = // ...
+        let person = try transaction.importUniqueObject(
+            Into<Person>(),
+            source: json
+        )
+        // ...
+    },
+    completion: { (result) in
+        // ...
+    }
+)
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + UniqueIDType + +
    +
    +
    +
    +
    +
    +

    The data type for the entity’s unique ID attribute

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype UniqueIDType : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + uniqueIDKeyPath + +
    +
    +
    +
    +
    +
    +

    The keyPath to the entity’s unique ID attribute

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var uniqueIDKeyPath: String { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + uniqueIDValue + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    The object’s unique ID value. The default implementation returns the value of the attribute pertained to by uniqueIDKeyPath

    +
    +

    Important

    + It is the developer’s responsibility to ensure that the attribute value pertained by uniqueIDKeyPath is not nil during the call to uniqueIDValue. + +
    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var uniqueIDValue: UniqueIDType { get set }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Return true if an object should be created from source. Return false to ignore and skip source. The default implementation returns the value returned by the shouldUpdate(from:in:) implementation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func shouldInsert(from source: ImportSource, in transaction: BaseDataTransaction) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + source + + +
    +

    the object to import from

    +
    +
    + + transaction + + +
    +

    the transaction that invoked the import. Use the transaction to fetch or create related objects if needed.

    +
    +
    +
    +
    +

    Return Value

    +

    true if an object should be created from source. Return false to ignore.

    +
    +
    +
    +
  • +
  • +
    + + + + shouldUpdate(from:in:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Return true if an object should be updated from source. Return false to ignore and skip source. The default implementation returns true.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func shouldUpdate(from source: ImportSource, in transaction: BaseDataTransaction) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + source + + +
    +

    the object to import from

    +
    +
    + + transaction + + +
    +

    the transaction that invoked the import. Use the transaction to fetch or create related objects if needed.

    +
    +
    +
    +
    +

    Return Value

    +

    true if an object should be updated from source. Return false to ignore.

    +
    +
    +
    +
  • +
  • +
    + + + + uniqueID(from:in:) + +
    +
    +
    +
    +
    +
    +

    Return the unique ID as extracted from source. This method is called before shouldInsert(from:in:) or shouldUpdate(from:in:). Return nil to skip importing from source. Note that throwing from this method will cause subsequent imports that are part of the same importUniqueObjects(:sourceArray:) call to be cancelled.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func uniqueID(from source: ImportSource, in transaction: BaseDataTransaction) throws -> UniqueIDType?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + source + + +
    +

    the object to import from

    +
    +
    + + transaction + + +
    +

    the transaction that invoked the import. Use the transaction to fetch or create related objects if needed.

    +
    +
    +
    +
    +

    Return Value

    +

    the unique ID as extracted from source, or nil to skip importing from source.

    +
    +
    +
    +
  • +
  • +
    + + + + didInsert(from:in:) + +
    +
    +
    +
    +
    +
    +

    Implements the actual importing of data from source. This method is called just after the object is created and assigned its unique ID as returned from uniqueID(from:in:). Implementers should pull values from source and assign them to the receiver’s attributes. Note that throwing from this method will cause subsequent imports that are part of the same importUniqueObjects(:sourceArray:) call to be cancelled. The default implementation simply calls update(from:in:).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func didInsert(from source: ImportSource, in transaction: BaseDataTransaction) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + source + + +
    +

    the object to import from

    +
    +
    + + transaction + + +
    +

    the transaction that invoked the import. Use the transaction to fetch or create related objects if needed.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + update(from:in:) + +
    +
    +
    +
    +
    +
    +

    Implements the actual importing of data from source. This method is called just after the existing object is fetched using its unique ID. Implementers should pull values from source and assign them to the receiver’s attributes. Note that throwing from this method will cause subsequent imports that are part of the same importUniqueObjects(:sourceArray:) call to be cancelled.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func update(from source: ImportSource, in transaction: BaseDataTransaction) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + source + + +
    +

    the object to import from

    +
    +
    + + transaction + + +
    +

    the transaction that invoked the import. Use the transaction to fetch or create related objects if needed.

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/ListObjectObserver.html b/docs/Protocols/ListObjectObserver.html new file mode 100644 index 0000000..af1cd4b --- /dev/null +++ b/docs/Protocols/ListObjectObserver.html @@ -0,0 +1,1119 @@ + + + + ListObjectObserver Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ListObjectObserver

+
+
+
@available(OSX 10.12, *)
+public protocol ListObjectObserver : ListObserver
+ +
+
+

Implement the ListObjectObserver protocol to observe detailed changes to a list’s object. ListObjectObservers may register themselves to a ListMonitor‘s addObserver(_:) method:

+
let monitor = CoreStore.monitorList(
+    From<MyPersonEntity>(),
+    OrderBy(.ascending("lastName"))
+)
+monitor.addObserver(self)
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + listMonitor(_:didInsertObject:toIndexPath:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies that an object was inserted to the specified NSIndexPath in the list. (Optional) +The default implementation does nothing.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func listMonitor(_ monitor: ListMonitor<ListEntityType>, didInsertObject object: ListEntityType, toIndexPath indexPath: IndexPath)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + monitor + + +
    +

    the ListMonitor monitoring the list being observed

    +
    +
    + + object + + +
    +

    the entity type for the inserted object

    +
    +
    + + indexPath + + +
    +

    the new NSIndexPath for the inserted object

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + listMonitor(_:didDeleteObject:fromIndexPath:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies that an object was deleted from the specified NSIndexPath in the list. (Optional) +The default implementation does nothing.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func listMonitor(_ monitor: ListMonitor<ListEntityType>, didDeleteObject object: ListEntityType, fromIndexPath indexPath: IndexPath)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + monitor + + +
    +

    the ListMonitor monitoring the list being observed

    +
    +
    + + object + + +
    +

    the entity type for the deleted object

    +
    +
    + + indexPath + + +
    +

    the NSIndexPath for the deleted object

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + listMonitor(_:didUpdateObject:atIndexPath:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies that an object at the specified NSIndexPath was updated. (Optional) +The default implementation does nothing.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func listMonitor(_ monitor: ListMonitor<ListEntityType>, didUpdateObject object: ListEntityType, atIndexPath indexPath: IndexPath)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + monitor + + +
    +

    the ListMonitor monitoring the list being observed

    +
    +
    + + object + + +
    +

    the entity type for the updated object

    +
    +
    + + indexPath + + +
    +

    the NSIndexPath for the updated object

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + listMonitor(_:didMoveObject:fromIndexPath:toIndexPath:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies that an object’s index changed. (Optional) +The default implementation does nothing.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func listMonitor(_ monitor: ListMonitor<ListEntityType>, didMoveObject object: ListEntityType, fromIndexPath: IndexPath, toIndexPath: IndexPath)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + monitor + + +
    +

    the ListMonitor monitoring the list being observed

    +
    +
    + + object + + +
    +

    the entity type for the moved object

    +
    +
    + + fromIndexPath + + +
    +

    the previous NSIndexPath for the moved object

    +
    +
    + + toIndexPath + + +
    +

    the new NSIndexPath for the moved object

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/ListObserver.html b/docs/Protocols/ListObserver.html new file mode 100644 index 0000000..99aa35d --- /dev/null +++ b/docs/Protocols/ListObserver.html @@ -0,0 +1,1031 @@ + + + + ListObserver Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ListObserver

+
+
+
@available(OSX 10.12, *)
+public protocol ListObserver : AnyObject
+ +
+
+

Implement the ListObserver protocol to observe changes to a list of NSManagedObjects. ListObservers may register themselves to a ListMonitor‘s addObserver(_:) method:

+
let monitor = CoreStore.monitorList(
+    From<Person>(),
+    OrderBy(.ascending("lastName"))
+)
+monitor.addObserver(self)
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + ListEntityType + +
    +
    +
    +
    +
    +
    +

    The NSManagedObject type for the observed list

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype ListEntityType : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + listMonitorWillChange(_:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Handles processing just before a change to the observed list occurs. (Optional) +The default implementation does nothing.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func listMonitorWillChange(_ monitor: ListMonitor<ListEntityType>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + monitor + + +
    +

    the ListMonitor monitoring the list being observed

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Handles processing right after a change to the observed list occurs. (Required)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func listMonitorDidChange(_ monitor: ListMonitor<ListEntityType>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + monitor + + +
    +

    the ListMonitor monitoring the object being observed

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + listMonitorWillRefetch(_:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    This method is broadcast from within the ListMonitor‘s refetch(...) method to let observers prepare for the internal NSFetchedResultsController’s pending change to its predicate, sort descriptors, etc. (Optional)

    +
    +

    Important

    + All ListMonitor access between listMonitorWillRefetch(_:) and listMonitorDidRefetch(_:) will raise and assertion. The actual refetch will happen after the NSFetchedResultsController’s last controllerDidChangeContent(_:) notification completes. + +
    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func listMonitorWillRefetch(_ monitor: ListMonitor<ListEntityType>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + monitor + + +
    +

    the ListMonitor monitoring the object being observed

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    After the ListMonitor‘s refetch(...) method is called, this method is broadcast after the NSFetchedResultsController’s last controllerDidChangeContent(_:) notification completes. (Required)

    +
    +

    Important

    + When listMonitorDidRefetch(_:) is called it should be assumed that all ListMonitor’s previous data have been reset, including counts, objects, and persistent stores. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func listMonitorDidRefetch(_ monitor: ListMonitor<ListEntityType>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + monitor + + +
    +

    the ListMonitor monitoring the object being observed

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/ListSectionObserver.html b/docs/Protocols/ListSectionObserver.html new file mode 100644 index 0000000..606d8c0 --- /dev/null +++ b/docs/Protocols/ListSectionObserver.html @@ -0,0 +1,952 @@ + + + + ListSectionObserver Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ListSectionObserver

+
+
+
@available(OSX 10.12, *)
+public protocol ListSectionObserver : ListObjectObserver
+ +
+
+

Implement the ListSectionObserver protocol to observe changes to a list’s section info. ListSectionObservers may register themselves to a ListMonitor‘s addObserver(_:) method:

+
let monitor = CoreStore.monitorSectionedList(
+    From<MyPersonEntity>(),
+    SectionBy("age") { "Age \($0)" },
+    OrderBy(.ascending("lastName"))
+)
+monitor.addObserver(self)
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + listMonitor(_:didInsertSection:toSectionIndex:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies that a section was inserted at the specified index. (Optional) +The default implementation does nothing.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func listMonitor(_ monitor: ListMonitor<ListEntityType>, didInsertSection sectionInfo: NSFetchedResultsSectionInfo, toSectionIndex sectionIndex: Int)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + monitor + + +
    +

    the ListMonitor monitoring the list being observed

    +
    +
    + + sectionInfo + + +
    +

    the NSFetchedResultsSectionInfo for the inserted section

    +
    +
    + + sectionIndex + + +
    +

    the new section index for the new section

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + listMonitor(_:didDeleteSection:fromSectionIndex:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies that a section was inserted at the specified index. (Optional) +The default implementation does nothing.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func listMonitor(_ monitor: ListMonitor<ListEntityType>, didDeleteSection sectionInfo: NSFetchedResultsSectionInfo, fromSectionIndex sectionIndex: Int)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + monitor + + +
    +

    the ListMonitor monitoring the list being observed

    +
    +
    + + sectionInfo + + +
    +

    the NSFetchedResultsSectionInfo for the deleted section

    +
    +
    + + sectionIndex + + +
    +

    the previous section index for the deleted section

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/LocalStorage.html b/docs/Protocols/LocalStorage.html new file mode 100644 index 0000000..3295b3e --- /dev/null +++ b/docs/Protocols/LocalStorage.html @@ -0,0 +1,950 @@ + + + + LocalStorage Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

LocalStorage

+
+
+
public protocol LocalStorage : StorageInterface
+ +
+
+

The LocalStorage represents StorageInterfaces that are backed by local files.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + fileURL + +
    +
    +
    +
    +
    +
    +

    The NSURL that points to the store file

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var fileURL: URL { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    An array of SchemaMappingProviders that provide the complete mapping models for custom migrations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var migrationMappingProviders: [SchemaMappingProvider] { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + localStorageOptions + +
    +
    +
    +
    +
    +
    +

    Options that tell the DataStack how to setup the persistent store

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var localStorageOptions: LocalStorageOptions { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The options dictionary for the specified LocalStorageOptions

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func dictionary(forOptions options: LocalStorageOptions) -> [AnyHashable : Any]?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Called by the DataStack to perform checkpoint operations on the storage. (SQLite stores for example, can convert the database’s WAL journaling mode to DELETE to force a checkpoint)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func cs_finalizeStorageAndWait(soureModelHint: NSManagedObjectModel) throws
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Called by the DataStack to perform actual deletion of the store file from disk. Do not call directly! The sourceModel argument is a hint for the existing store’s model version. Implementers can use the sourceModel to perform necessary store operations. (SQLite stores for example, can convert WAL journaling mode to DELETE before deleting)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func cs_eraseStorageAndWait(metadata: [String : Any], soureModelHint: NSManagedObjectModel?) throws
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/ObjectObserver.html b/docs/Protocols/ObjectObserver.html new file mode 100644 index 0000000..5a81e10 --- /dev/null +++ b/docs/Protocols/ObjectObserver.html @@ -0,0 +1,1029 @@ + + + + ObjectObserver Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ObjectObserver

+
+
+
@available(OSX 10.12, *)
+public protocol ObjectObserver : AnyObject
+ +
+
+

Implement the ObjectObserver protocol to observe changes to a single DynamicObject instance. ObjectObservers may register themselves to a ObjectMonitor‘s addObserver(_:) method:

+
let monitor = CoreStore.monitorObject(object)
+monitor.addObserver(self)
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + ObjectEntityType + +
    +
    +
    +
    +
    +
    +

    The DynamicObject type for the observed object

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype ObjectEntityType : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + objectMonitor(_:willUpdateObject:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Handles processing just before a change to the observed object occurs. (Optional) +The default implementation does nothing.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func objectMonitor(_ monitor: ObjectMonitor<ObjectEntityType>, willUpdateObject object: ObjectEntityType)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + monitor + + +
    +

    the ObjectMonitor monitoring the object being observed

    +
    +
    + + object + + +
    +

    the DynamicObject instance being observed

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + objectMonitor(_:didUpdateObject:changedPersistentKeys:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Handles processing right after a change to the observed object occurs. (Optional) +The default implementation does nothing.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func objectMonitor(_ monitor: ObjectMonitor<ObjectEntityType>, didUpdateObject object: ObjectEntityType, changedPersistentKeys: Set<KeyPathString>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + monitor + + +
    +

    the ObjectMonitor monitoring the object being observed

    +
    +
    + + object + + +
    +

    the DynamicObject instance being observed

    +
    +
    + + changedPersistentKeys + + +
    +

    a Set of key paths for the attributes that were changed. Note that changedPersistentKeys only contains keys for attributes/relationships present in the persistent store, thus transient properties will not be reported.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + objectMonitor(_:didDeleteObject:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Handles processing right after object is deleted. (Optional) +The default implementation does nothing.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func objectMonitor(_ monitor: ObjectMonitor<ObjectEntityType>, didDeleteObject object: ObjectEntityType)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + monitor + + +
    +

    the ObjectMonitor monitoring the object being observed

    +
    +
    + + object + + +
    +

    the DynamicObject instance being observed

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/OrderByClause.html b/docs/Protocols/OrderByClause.html new file mode 100644 index 0000000..d91b69e --- /dev/null +++ b/docs/Protocols/OrderByClause.html @@ -0,0 +1,842 @@ + + + + OrderByClause Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

OrderByClause

+
+
+
public protocol OrderByClause
+ +
+
+

Abstracts the OrderBy clause for protocol utilities.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    +

    The DynamicObject type associated with the clause

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype ObjectType : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + sortDescriptors + +
    +
    +
    +
    +
    +
    +

    The NSSortDescriptor array for the fetch or query

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var sortDescriptors: [NSSortDescriptor] { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/QueryChainableBuilderType.html b/docs/Protocols/QueryChainableBuilderType.html new file mode 100644 index 0000000..7dceae9 --- /dev/null +++ b/docs/Protocols/QueryChainableBuilderType.html @@ -0,0 +1,923 @@ + + + + QueryChainableBuilderType Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

QueryChainableBuilderType

+
+
+
public protocol QueryChainableBuilderType
+ +
+
+

Utility protocol for QueryChainBuilder. Used in fetch methods that support chained query builders.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    +

    The DynamicObject type for the query

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype ObjectType : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ResultType + +
    +
    +
    +
    +
    +
    +

    The SelectResultType type for the query

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype ResultType : SelectResultType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + from + +
    +
    +
    +
    +
    +
    +

    The From clause specifies the source entity and source persistent store for the query

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var from: From<ObjectType> { get set }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + select + +
    +
    +
    +
    +
    +
    +

    The Select clause to be used for the query

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var select: Select<ObjectType, ResultType> { get set }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + queryClauses + +
    +
    +
    +
    +
    +
    +

    The QueryClauses to be used for the query

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var queryClauses: [QueryClause] { get set }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/QueryableAttributeType.html b/docs/Protocols/QueryableAttributeType.html new file mode 100644 index 0000000..86736d3 --- /dev/null +++ b/docs/Protocols/QueryableAttributeType.html @@ -0,0 +1,927 @@ + + + + QueryableAttributeType Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

QueryableAttributeType

+
+
+
public protocol QueryableAttributeType : SelectResultType, Hashable
+ +
+
+

Types supported by CoreStore for querying, especially as generic type for Select clauses. +Supported default types:

+ +
    +
  • Bool
  • +
  • CGFloat
  • +
  • Data
  • +
  • Date
  • +
  • Double
  • +
  • Float
  • +
  • Int
  • +
  • Int8
  • +
  • Int16
  • +
  • Int32
  • +
  • Int64
  • +
  • NSData
  • +
  • NSDate
  • +
  • NSDecimalNumber
  • +
  • NSManagedObjectID
  • +
  • NSNull
  • +
  • NSNumber
  • +
  • NSString
  • +
  • NSURL
  • +
  • NSUUID
  • +
  • String
  • +
  • URL
  • +
  • UUID
  • +
+ +

In addition, RawRepresentable types whose RawValue already implements QueryableAttributeType only need to declare conformance to QueryableAttributeType.

+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/QueryableSource.html b/docs/Protocols/QueryableSource.html new file mode 100644 index 0000000..289c636 --- /dev/null +++ b/docs/Protocols/QueryableSource.html @@ -0,0 +1,1244 @@ + + + + QueryableSource Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

QueryableSource

+
+
+
public protocol QueryableSource : AnyObject
+ +
+
+

Encapsulates containers which manages an internal NSManagedObjectContext, such as DataStacks and transactions, that can be used for querying values. CoreStore provides implementations for this protocol and should be used as a read-only abstraction.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + queryValue(_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Queries aggregate values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func queryValue<D, U>(_ from: From<D>, _ selectClause: Select<D, U>, _ queryClauses: QueryClause...) -> U? where D : DynamicObject, U : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • +
    + + + + queryValue(_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Queries aggregate values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func queryValue<D, U>(_ from: From<D>, _ selectClause: Select<D, U>, _ queryClauses: [QueryClause]) -> U? where D : DynamicObject, U : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • +
    + + + + queryValue(_:) + +
    +
    +
    +
    +
    +
    +

    Queries a property value or aggregate as specified by the QueryChainableBuilderType built from a chain of clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    +
    let averageAdultAge = dataStack.queryValue(
    +    From<MyPersonEntity>()
    +        .select(Int.self, .average(\.age))
    +        .where(\.age > 18)
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func queryValue<B>(_ clauseChain: B) -> B.ResultType? where B : QueryChainableBuilderType, B.ResultType : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a QueryChainableBuilderType indicating the property/aggregate to fetch and the series of queries for the request.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query as specified by the QueryChainableBuilderType

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Queries a dictionary of attribute values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func queryAttributes<D>(_ from: From<D>, _ selectClause: Select<D, NSDictionary>, _ queryClauses: QueryClause...) -> [[String : Any]]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Queries a dictionary of attribute values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func queryAttributes<D>(_ from: From<D>, _ selectClause: Select<D, NSDictionary>, _ queryClauses: [QueryClause]) -> [[String : Any]]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • +
    + + + + queryAttributes(_:) + +
    +
    +
    +
    +
    +
    +

    Queries a dictionary of attribute values or as specified by the QueryChainableBuilderType built from a chain of clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    +
    let results = source.queryAttributes(
    +    From<MyPersonEntity>()
    +        .select(
    +            NSDictionary.self,
    +            .attribute(\.age, as: "age"),
    +            .count(\.age, as: "numberOfPeople")
    +        )
    +        .groupBy(\.age)
    +)
    +for dictionary in results! {
    +    let age = dictionary["age"] as! Int
    +    let count = dictionary["numberOfPeople"] as! Int
    +    print("There are \(count) people who are \(age) years old."
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func queryAttributes<B>(_ clauseChain: B) -> [[String : Any]]? where B : QueryChainableBuilderType, B.ResultType == NSDictionary
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a QueryChainableBuilderType indicating the properties to fetch and the series of queries for the request.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query as specified by the QueryChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + unsafeContext() + +
    +
    +
    +
    +
    +
    +

    The internal NSManagedObjectContext managed by this QueryableSource. Using this context directly should typically be avoided, and is provided by CoreStore only for extremely specialized cases.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func unsafeContext() -> NSManagedObjectContext
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/SchemaMappingProvider.html b/docs/Protocols/SchemaMappingProvider.html new file mode 100644 index 0000000..a83d3b5 --- /dev/null +++ b/docs/Protocols/SchemaMappingProvider.html @@ -0,0 +1,815 @@ + + + + SchemaMappingProvider Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SchemaMappingProvider

+
+
+
public protocol SchemaMappingProvider
+ +
+
+

The SchemaMappingProvider provides migration mapping information between two DynamicSchema versions.

+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/SectionMonitorBuilderType.html b/docs/Protocols/SectionMonitorBuilderType.html new file mode 100644 index 0000000..d1a15f2 --- /dev/null +++ b/docs/Protocols/SectionMonitorBuilderType.html @@ -0,0 +1,897 @@ + + + + SectionMonitorBuilderType Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SectionMonitorBuilderType

+
+
+
@available(OSX 10.12, *)
+public protocol SectionMonitorBuilderType
+ +
+
+

Utility protocol for SectionMonitorChainBuilder. Used in methods that support chained fetch builders.

+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/SelectClause.html b/docs/Protocols/SelectClause.html new file mode 100644 index 0000000..2d2825b --- /dev/null +++ b/docs/Protocols/SelectClause.html @@ -0,0 +1,869 @@ + + + + SelectClause Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SelectClause

+
+
+
public protocol SelectClause
+ +
+
+

Abstracts the Select clause for protocol utilities.

+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/StorageInterface.html b/docs/Protocols/StorageInterface.html new file mode 100644 index 0000000..3c95387 --- /dev/null +++ b/docs/Protocols/StorageInterface.html @@ -0,0 +1,934 @@ + + + + StorageInterface Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

StorageInterface

+
+
+
public protocol StorageInterface : AnyObject
+ +
+
+

The StorageInterface represents the data store managed (or to be managed) by the DataStack. When added to the DataStack, the StorageInterface serves as the interface for the NSPersistentStore. This may be a database file, an in-memory store, etc.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + storeType + +
    +
    +
    +
    +
    +
    +

    The string identifier for the NSPersistentStore‘s type property. This is the same string CoreStore will use to create the NSPersistentStore from the NSPersistentStoreCoordinator’s addPersistentStoreWithType(...) method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var storeType: String { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    +

    The configuration name in the model file

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var configuration: ModelConfiguration { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + storeOptions + +
    +
    +
    +
    +
    +
    +

    The options dictionary for the NSPersistentStore

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var storeOptions: [AnyHashable : Any]? { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+
+ +
+
+ + + + diff --git a/docs/Protocols/WhereClauseType.html b/docs/Protocols/WhereClauseType.html new file mode 100644 index 0000000..1004c7b --- /dev/null +++ b/docs/Protocols/WhereClauseType.html @@ -0,0 +1,966 @@ + + + + WhereClauseType Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

WhereClauseType

+
+
+
public protocol WhereClauseType : AnyWhereClause
+ +
+
+

Abstracts the Where clause for protocol utilities.

+ +
+
+ +
+
+
+ +
+
+ +
    +
  • +
    + + + + &&(_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Combines two Where predicates together using AND operator.

    +
    +

    Warning

    + This operator overload is a workaround for Swift generics’ inability to constrain by inheritance (https://bugs.swift.org/browse/SR-5213). In effect, this is less type-safe than other overloads because it allows AND'ing clauses of unrelated DynamicObject types. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func && <TWhere>(left: Self, right: TWhere) -> Self where TWhere : WhereClauseType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + &&(_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Combines two Where predicates together using AND operator.

    +
    +

    Warning

    + This operator overload is a workaround for Swift generics’ inability to constrain by inheritance (https://bugs.swift.org/browse/SR-5213). In effect, this is less type-safe than other overloads because it allows AND'ing clauses of unrelated DynamicObject types. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func && <TWhere>(left: TWhere, right: Self) -> Self where TWhere : WhereClauseType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ||(_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Combines two Where predicates together using OR operator.

    +
    +

    Warning

    + This operator overload is a workaround for Swift generics’ inability to constrain by inheritance (https://bugs.swift.org/browse/SR-5213). In effect, this is less type-safe than other overloads because it allows OR'ing clauses of unrelated DynamicObject types. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func || <TWhere>(left: Self, right: TWhere) -> Self where TWhere : WhereClauseType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ||(_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Combines two Where predicates together using OR operator.

    +
    +

    Warning

    + This operator overload is a workaround for Swift generics’ inability to constrain by inheritance (https://bugs.swift.org/browse/SR-5213). In effect, this is less type-safe than other overloads because it allows OR'ing clauses of unrelated DynamicObject types. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func || <TWhere>(left: TWhere, right: Self) -> Self where TWhere : WhereClauseType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Structs.html b/docs/Structs.html new file mode 100644 index 0000000..caf7630 --- /dev/null +++ b/docs/Structs.html @@ -0,0 +1,1556 @@ + + + + Structures Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Structures

+

The following structures are available globally.

+ +
+
+ +
+
+
+
+ + + +

Tweak

+
+
+
    +
  • +
    + + + + Tweak + +
    +
    +
    +
    +
    +
    +

    The Tweak clause allows fine-tuning the NSFetchRequest for a fetch or query. +Sample usage:

    +
    let employees = transaction.fetchAll(
    +    From<MyPersonEntity>(),
    +    Tweak { (fetchRequest) -> Void in
    +        fetchRequest.includesPendingChanges = false
    +        fetchRequest.fetchLimit = 5
    +    }
    +)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct Tweak : FetchClause, QueryClause, DeleteClause
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CloudStorageOptions + +
    +
    +
    +
    +
    +
    +

    The CloudStorageOptions provides settings that tells the DataStack how to setup the persistent store for LocalStorage implementers.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct CloudStorageOptions : OptionSet, ExpressibleByNilLiteral
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

From

+
+
+
    +
  • +
    + + + + From + +
    +
    +
    +
    +
    +
    +

    A From clause specifies the source entity and source persistent store for fetch and query methods. A common usage is to just indicate the entity:

    +
    let person = transaction.fetchOne(From<Person>())
    +
    + +

    For cases where multiple NSPersistentStores contain the same entity, the source configuration’s name needs to be specified as well:

    +
    let person = transaction.fetchOne(From<Person>("Configuration1"))
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct From<D> where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + GroupBy + +
    +
    +
    +
    +
    +
    +

    The GroupBy clause specifies that the result of a query be grouped accoording to the specified key path.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct GroupBy<D> : GroupByClause, QueryClause, Hashable where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Into

+
+
+
    +
  • +
    + + + + Into + +
    +
    +
    +
    +
    +
    +

    An Into clause contains the destination entity and destination persistent store for a create(...) method. A common usage is to just indicate the entity:

    +
    let person = transaction.create(Into<MyPersonEntity>())
    +
    + +

    For cases where multiple NSPersistentStores contain the same entity, the destination configuration’s name needs to be specified as well:

    +
    let person = transaction.create(Into<MyPersonEntity>("Configuration1"))
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct Into<D> : Hashable where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + LocalStorageOptions + +
    +
    +
    +
    +
    +
    +

    The LocalStorageOptions provides settings that tells the DataStack how to setup the persistent store for LocalStorage implementers.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct LocalStorageOptions : OptionSet, ExpressibleByNilLiteral
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + MigrationChain + +
    +
    +
    +
    +
    +
    +

    A MigrationChain indicates the sequence of model versions to be used as the order for progressive migrations. This is typically passed to the SchemaHistory or the DataStack initializer and will be applied to all stores added to the DataStack with addStorage(...) and its variants.

    + +

    Initializing with empty values (either nil, [], or [:]) instructs the DataStack to use the .xcdatamodel’s current version as the final version, and to disable progressive migrations:

    +
    let dataStack = DataStack(migrationChain: nil)
    +
    + +

    This means that the mapping model will be computed from the store’s version straight to the DataStack‘s model version. +To support progressive migrations, specify the linear order of versions:

    +
    let dataStack = DataStack(migrationChain:
    +   ["MyAppModel", "MyAppModelV2", "MyAppModelV3", "MyAppModelV4"])
    +
    + +

    or for more complex migration paths, a version tree that maps the key-values to the source-destination versions:

    +
    let dataStack = DataStack(migrationChain: [
    +    "MyAppModel": "MyAppModelV3",
    +    "MyAppModelV2": "MyAppModelV4",
    +    "MyAppModelV3": "MyAppModelV4"
    +])
    +
    + +

    This allows for different migration paths depending on the starting version. The example above resolves to the following paths:

    + +
      +
    • MyAppModel-MyAppModelV3-MyAppModelV4
    • +
    • MyAppModelV2-MyAppModelV4
    • +
    • MyAppModelV3-MyAppModelV4
    • +
    + +

    The MigrationChain is validated when passed to the DataStack and unless it is empty, will raise an assertion if any of the following conditions are met:

    + +
      +
    • a version appears twice in an array
    • +
    • a version appears twice as a key in a dictionary literal
    • +
    • a loop is found in any of the paths
    • +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct MigrationChain : ExpressibleByNilLiteral, ExpressibleByStringLiteral, ExpressibleByDictionaryLiteral, ExpressibleByArrayLiteral, Equatable
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + SectionBy + +
    +
    +
    +
    +
    +
    +

    The SectionBy clause indicates the key path to use to group the ListMonitor objects into sections. An optional closure can also be provided to transform the value into an appropriate section name:

    +
    let monitor = CoreStore.monitorSectionedList(
    +    From<Person>(),
    +    SectionBy("age") { "Age \($0)" },
    +    OrderBy(.ascending("lastName"))
    +)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public struct SectionBy<D> where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Select

+
+
+
    +
  • +
    + + + + Select + +
    +
    +
    +
    +
    +
    +

    The Select clause indicates the attribute / aggregate value to be queried. The generic type is a SelectResultType, and will be used as the return type for the query.

    + +

    You can bind the return type by specializing the initializer:

    +
    let maximumAge = CoreStore.queryValue(
    +    From<MyPersonEntity>(),
    +    Select<Int>(.maximum("age"))
    +)
    +
    + +

    or by casting the type of the return value:

    +
    let maximumAge: Int = CoreStore.queryValue(
    +    From<MyPersonEntity>(),
    +    Select(.maximum("age"))
    +)
    +
    + +

    Valid return types depend on the query:

    + +
      +
    • for queryValue(...) methods: + +
    • +
    • for queryAttributes(...) methods:

      + +
        +
      • NSDictionary
      • +
    • +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct Select<D, T> : SelectClause, Hashable where D : DynamicObject, T : SelectResultType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sortDescriptors + + +
    +

    a series of NSSortDescriptors

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Where

+
+
+ +
+
+ +
    +
  • +
    + + + + VersionLock + +
    +
    +
    +
    +
    +
    +

    The VersionLock contains the version hashes for entities. This is then passed to the CoreStoreSchema, which contains all entities for the store. An assertion will be raised if any Entity doesn’t match the version hash.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let nickname = Value.Optional<String>("nickname")
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let name = Value.Required<String>("name", initial: "")
    +    let pet = Relationship.ToOne<Animal>("pet", inverse: { $0.master })
    +}
    +
    +CoreStore.defaultStack = DataStack(
    +    CoreStoreSchema(
    +        modelVersion: "V1",
    +        entities: [
    +            Entity<Animal>("Animal"),
    +            Entity<Person>("Person")
    +        ],
    +        versionLock: [
    +            "Animal": [0x2698c812ebbc3b97, 0x751e3fa3f04cf9, 0x51fd460d3babc82, 0x92b4ba735b5a3053],
    +            "Person": [0xae4060a59f990ef0, 0x8ac83a6e1411c130, 0xa29fea58e2e38ab6, 0x2071bb7e33d77887]
    +        ]
    +    )
    +)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct VersionLock : ExpressibleByDictionaryLiteral, Equatable
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + FetchChainBuilder + +
    +
    +
    +
    +
    +
    +

    The fetch builder type used for fetches. A FetchChainBuilder is created from a From clause.

    +
    let people = source.fetchAll(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct FetchChainBuilder<D> : FetchChainableBuilderType where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + QueryChainBuilder + +
    +
    +
    +
    +
    +
    +

    The fetch builder type used for a queries. A QueryChainBuilder is created from a From clause and then a select(...) chain.

    +
    let averageAdultAge = dataStack.queryValue(
    +    From<MyPersonEntity>()
    +        .select(Int.self, .average(\.age))
    +        .where(\.age > 18)
    +)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct QueryChainBuilder<D, R> : QueryChainableBuilderType where D : DynamicObject, R : SelectResultType
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    The fetch builder type used for a sectioned ListMonitor. A SectionMonitorChainBuilder is created from a From clause and then a sectionBy(...) chain.

    +
    let monitor = transaction.monitorSectionedList(
    +    From<MyPersonEntity>()
    +        .sectionBy(\.age, { "\($0!) years old" })
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public struct SectionMonitorChainBuilder<D> : SectionMonitorBuilderType where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + PartialObject + +
    +
    +
    +
    +
    +
    +

    A PartialObject is only used when overriding getters and setters for CoreStoreObject properties. Custom getters and setters are implemented as a closure that overrides the default property getter/setter. The closure receives a PartialObject<O>, which acts as a fast, type-safe KVC interface for CoreStoreObject. The reason a CoreStoreObject instance is not passed directly is because the Core Data runtime is not aware of CoreStoreObject properties’ static typing, and so loading those info everytime KVO invokes this accessor method incurs a heavy performance hit (especially in KVO-heavy operations such as ListMonitor observing.) When accessing the property value from PartialObject<O>, make sure to use PartialObject<O>.persistentValue(for:) instead of PartialObject<O>.value(for:), which would unintentionally execute the same closure again recursively.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct PartialObject<O> where O : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Structs/CloudStorageOptions.html b/docs/Structs/CloudStorageOptions.html new file mode 100644 index 0000000..9b18f87 --- /dev/null +++ b/docs/Structs/CloudStorageOptions.html @@ -0,0 +1,1017 @@ + + + + CloudStorageOptions Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CloudStorageOptions

+
+
+
public struct CloudStorageOptions : OptionSet, ExpressibleByNilLiteral
+ +
+
+

The CloudStorageOptions provides settings that tells the DataStack how to setup the persistent store for LocalStorage implementers.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + none + +
    +
    +
    +
    +
    +
    +

    Tells the DataStack that the store should not be migrated or recreated, and should simply fail on model mismatch

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let none: CloudStorageOptions
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Tells the DataStack to delete and recreate the local store from the cloud store on model mismatch, otherwise exceptions will be thrown on failure instead

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let recreateLocalStoreOnModelMismatch: CloudStorageOptions
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Tells the DataStack to allow lightweight migration for the store when added synchronously

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let allowSynchronousLightweightMigration: CloudStorageOptions
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + init(rawValue:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(rawValue: Int)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + rawValue + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let rawValue: Int
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + init(nilLiteral:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(nilLiteral: ())
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Structs/FetchChainBuilder.html b/docs/Structs/FetchChainBuilder.html new file mode 100644 index 0000000..0603645 --- /dev/null +++ b/docs/Structs/FetchChainBuilder.html @@ -0,0 +1,1276 @@ + + + + FetchChainBuilder Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

FetchChainBuilder

+
+
+
public struct FetchChainBuilder<D> : FetchChainableBuilderType where D : DynamicObject
+ +
+
+

The fetch builder type used for fetches. A FetchChainBuilder is created from a From clause.

+
let people = source.fetchAll(
+    From<MyPersonEntity>()
+        .where(\.age > 18)
+        .orderBy(.ascending(\.age))
+)
+
+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = D
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + from + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var from: From<D>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchClauses + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var fetchClauses: [FetchClause]
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

From

+
+
+
    +
  • +
    + + + + where(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a Where clause to the FetchChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func `where`(_ clause: Where<D>) -> FetchChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clause + + +
    +

    a Where clause to add to the fetch builder

    +
    +
    +
    +
    +

    Return Value

    +

    a new FetchChainBuilder containing the Where clause

    +
    +
    +
    +
  • +
  • +
    + + + + where(format:_:) + +
    +
    +
    +
    +
    +
    +

    Adds a Where clause to the FetchChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func `where`(format: String, _ args: Any...) -> FetchChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + format + + +
    +

    the format string for the predicate

    +
    +
    + + args + + +
    +

    the arguments for format

    +
    +
    +
    +
    +

    Return Value

    +

    a new FetchChainBuilder containing the Where clause

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Adds a Where clause to the FetchChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func `where`(format: String, argumentArray: [Any]?) -> FetchChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + format + + +
    +

    the format string for the predicate

    +
    +
    + + argumentArray + + +
    +

    the arguments for format

    +
    +
    +
    +
    +

    Return Value

    +

    a new FetchChainBuilder containing the Where clause

    +
    +
    +
    +
  • +
  • +
    + + + + orderBy(_:_:) + +
    +
    +
    +
    +
    +
    +

    Adds an OrderBy clause to the FetchChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func orderBy(_ sortKey: OrderBy<D>.SortKey, _ sortKeys: OrderBy<D>.SortKey...) -> FetchChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sortKey + + +
    +

    a single SortKey

    +
    +
    + + sortKeys + + +
    +

    a series of other SortKeys

    +
    +
    +
    +
    +

    Return Value

    +

    a new FetchChainBuilder containing the OrderBy clause

    +
    +
    +
    +
  • +
  • +
    + + + + tweak(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a Tweak clause to the FetchChainBuilder with a closure where the NSFetchRequest may be configured

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func tweak(_ fetchRequest: @escaping (NSFetchRequest<NSFetchRequestResult>) -> Void) -> FetchChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + fetchRequest + + +
    +

    the block to customize the NSFetchRequest

    +
    +
    +
    +
    +

    Return Value

    +

    a new FetchChainBuilder containing the Tweak clause

    +
    +
    +
    +
  • +
  • +
    + + + + appending(_:) + +
    +
    +
    +
    +
    +
    +

    Appends a FetchClause to the FetchChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func appending(_ clause: FetchClause) -> FetchChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clause + + +
    +

    the FetchClause to add to the FetchChainBuilder

    +
    +
    +
    +
    +

    Return Value

    +

    a new FetchChainBuilder containing the FetchClause

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Appends a series of FetchClauses to the FetchChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func appending<S>(contentsOf clauses: S) -> FetchChainBuilder<D> where S : Sequence, S.Element == FetchClause
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauses + + +
    +

    the FetchClauses to add to the FetchChainBuilder

    +
    +
    +
    +
    +

    Return Value

    +

    a new FetchChainBuilder containing the FetchClauses

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Structs/From.html b/docs/Structs/From.html new file mode 100644 index 0000000..17de2aa --- /dev/null +++ b/docs/Structs/From.html @@ -0,0 +1,2873 @@ + + + + From Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

From

+
+
+
public struct From<D> where D : DynamicObject
+ +
+
+

A From clause specifies the source entity and source persistent store for fetch and query methods. A common usage is to just indicate the entity:

+
let person = transaction.fetchOne(From<Person>())
+
+ +

For cases where multiple NSPersistentStores contain the same entity, the source configuration’s name needs to be specified as well:

+
let person = transaction.fetchOne(From<Person>("Configuration1"))
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + entityClass + +
    +
    +
    +
    +
    +
    +

    The associated NSManagedObject or CoreStoreObject entity class

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let entityClass: D.Type
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + configurations + +
    +
    +
    +
    +
    +
    +

    The NSPersistentStore configuration names to associate objects from. +May contain Strings to pertain to named configurations, or nil to pertain to the default configuration

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let configurations: [ModelConfiguration]?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes a From clause.

    +
    let people = transaction.fetchAll(From<MyPersonEntity>())
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a From clause with the specified entity type.

    +
    let people = transaction.fetchAll(From<MyPersonEntity>())
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ entity: D.Type)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the associated NSManagedObject or CoreStoreObject type

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a From clause with the specified configurations.

    +
    let people = transaction.fetchAll(From<MyPersonEntity>(nil, "Configuration1"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ configuration: ModelConfiguration, _ otherConfigurations: ModelConfiguration...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + configuration + + +
    +

    the NSPersistentStore configuration name to associate objects from. This parameter is required if multiple configurations contain the created NSManagedObject or CoreStoreObject‘s entity type. Set to nil to use the default configuration.

    +
    +
    + + otherConfigurations + + +
    +

    an optional list of other configuration names to associate objects from (see configuration parameter)

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a From clause with the specified configurations.

    +
    let people = transaction.fetchAll(From<MyPersonEntity>(["Configuration1", "Configuration2"]))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ configurations: [ModelConfiguration])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + configurations + + +
    +

    a list of NSPersistentStore configuration names to associate objects from. This parameter is required if multiple configurations contain the created NSManagedObject or CoreStoreObject‘s entity type. Set to nil to use the default configuration.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a From clause with the specified configurations.

    +
    let people = transaction.fetchAll(From(MyPersonEntity.self, nil, "Configuration1"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ entity: D.Type, _ configuration: ModelConfiguration, _ otherConfigurations: ModelConfiguration...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entity + + +
    +

    the associated NSManagedObject or CoreStoreObject type

    +
    +
    + + configuration + + +
    +

    the NSPersistentStore configuration name to associate objects from. This parameter is required if multiple configurations contain the created NSManagedObject or CoreStoreObject‘s entity type. Set to nil to use the default configuration.

    +
    +
    + + otherConfigurations + + +
    +

    an optional list of other configuration names to associate objects from (see configuration parameter)

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a From clause with the specified configurations.

    +
    let people = transaction.fetchAll(From(MyPersonEntity.self, ["Configuration1", "Configuration1"]))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ entity: D.Type, _ configurations: [ModelConfiguration])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + entity + + +
    +

    the associated NSManagedObject or CoreStoreObject type

    +
    +
    + + configurations + + +
    +

    a list of NSPersistentStore configuration names to associate objects from. This parameter is required if multiple configurations contain the created NSManagedObject or CoreStoreObject‘s entity type. Set to nil to use the default configuration.

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

From

+
+
+ +
+
+
+ + + +

From

+
+
+
    +
  • +
    + + + + select(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a QueryChainBuilder that starts with a Select clause created from the specified key path

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func select<R>(_ keyPath: KeyPath<D, R>) -> QueryChainBuilder<D, R> where R : SelectResultType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to query the value for

    +
    +
    +
    +
    +

    Return Value

    +

    a QueryChainBuilder that starts with a Select clause created from the specified key path

    +
    +
    +
    +
  • +
  • +
    + + + + sectionBy(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a SectionMonitorChainBuilder with the key path to use to group ListMonitor objects into sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public func sectionBy<T>(_ sectionKeyPath: KeyPath<D, T>) -> SectionMonitorChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sectionKeyPath + + +
    +

    the KeyPath to use to group the objects into sections

    +
    +
    +
    +
    +

    Return Value

    +

    a SectionMonitorChainBuilder that is sectioned by the specified key path

    +
    +
    +
    +
  • +
  • +
    + + + + sectionBy(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a SectionMonitorChainBuilder with the key path to use to group ListMonitor objects into sections, and a closure to transform the value for the key path to an appropriate section name

    +
    +

    Important

    + Some utilities (such as ListMonitors) may keep SectionBys in memory and may thus introduce retain cycles if reference captures are not handled properly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public func sectionBy<T>(_ sectionKeyPath: KeyPath<D, T>, _ sectionIndexTransformer: @escaping (_ sectionName: String?) -> String?) -> SectionMonitorChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionKeyPath + + +
    +

    the KeyPath to use to group the objects into sections

    +
    +
    + + sectionIndexTransformer + + +
    +

    a closure to transform the value for the key path to an appropriate section name

    +
    +
    +
    +
    +

    Return Value

    +

    a SectionMonitorChainBuilder that is sectioned by the specified key path

    +
    +
    +
    +
  • +
+
+
+
+ + + +

From

+
+
+
    +
  • +
    + + + + where(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a FetchChainBuilder that starts with the specified Where clause

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func `where`<T>(_ clause: (D) -> T) -> FetchChainBuilder<D> where T : AnyWhereClause
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clause + + +
    +

    a closure that returns a Where clause

    +
    +
    +
    +
    +

    Return Value

    +

    a FetchChainBuilder that starts with the specified Where clause

    +
    +
    +
    +
  • +
  • +
    + + + + select(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a QueryChainBuilder that starts with a Select clause created from the specified key path

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func select<R>(_ keyPath: KeyPath<D, ValueContainer<D>.Required<R>>) -> QueryChainBuilder<D, R> where R : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to query the value for

    +
    +
    +
    +
    +

    Return Value

    +

    a QueryChainBuilder that starts with a Select clause created from the specified key path

    +
    +
    +
    +
  • +
  • +
    + + + + select(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a QueryChainBuilder that starts with a Select clause created from the specified key path

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func select<R>(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<R>>) -> QueryChainBuilder<D, R> where R : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to query the value for

    +
    +
    +
    +
    +

    Return Value

    +

    a QueryChainBuilder that starts with a Select clause created from the specified key path

    +
    +
    +
    +
  • +
  • +
    + + + + select(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a QueryChainBuilder that starts with a Select clause created from the specified key path

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func select<R>(_ keyPath: KeyPath<D, TransformableContainer<D>.Required<R>>) -> QueryChainBuilder<D, R> where R : SelectResultType, R : NSCoding, R : NSCopying
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to query the value for

    +
    +
    +
    +
    +

    Return Value

    +

    a QueryChainBuilder that starts with a Select clause created from the specified key path

    +
    +
    +
    +
  • +
  • +
    + + + + select(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a QueryChainBuilder that starts with a Select clause created from the specified key path

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func select<R>(_ keyPath: KeyPath<D, TransformableContainer<D>.Optional<R>>) -> QueryChainBuilder<D, R> where R : SelectResultType, R : NSCoding, R : NSCopying
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to query the value for

    +
    +
    +
    +
    +

    Return Value

    +

    a QueryChainBuilder that starts with a Select clause created from the specified key path

    +
    +
    +
    +
  • +
  • +
    + + + + sectionBy(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a SectionMonitorChainBuilder with the key path to use to group ListMonitor objects into sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public func sectionBy<T>(_ sectionKeyPath: KeyPath<D, ValueContainer<D>.Required<T>>) -> SectionMonitorChainBuilder<D> where T : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sectionKeyPath + + +
    +

    the KeyPath to use to group the objects into sections

    +
    +
    +
    +
    +

    Return Value

    +

    a SectionMonitorChainBuilder that is sectioned by the specified key path

    +
    +
    +
    +
  • +
  • +
    + + + + sectionBy(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a SectionMonitorChainBuilder with the key path to use to group ListMonitor objects into sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public func sectionBy<T>(_ sectionKeyPath: KeyPath<D, ValueContainer<D>.Optional<T>>) -> SectionMonitorChainBuilder<D> where T : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sectionKeyPath + + +
    +

    the KeyPath to use to group the objects into sections

    +
    +
    +
    +
    +

    Return Value

    +

    a SectionMonitorChainBuilder that is sectioned by the specified key path

    +
    +
    +
    +
  • +
  • +
    + + + + sectionBy(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a SectionMonitorChainBuilder with the key path to use to group ListMonitor objects into sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public func sectionBy<T>(_ sectionKeyPath: KeyPath<D, TransformableContainer<D>.Required<T>>) -> SectionMonitorChainBuilder<D> where T : NSCoding, T : NSCopying
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sectionKeyPath + + +
    +

    the KeyPath to use to group the objects into sections

    +
    +
    +
    +
    +

    Return Value

    +

    a SectionMonitorChainBuilder that is sectioned by the specified key path

    +
    +
    +
    +
  • +
  • +
    + + + + sectionBy(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a SectionMonitorChainBuilder with the key path to use to group ListMonitor objects into sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public func sectionBy<T>(_ sectionKeyPath: KeyPath<D, TransformableContainer<D>.Optional<T>>) -> SectionMonitorChainBuilder<D> where T : NSCoding, T : NSCopying
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sectionKeyPath + + +
    +

    the KeyPath to use to group the objects into sections

    +
    +
    +
    +
    +

    Return Value

    +

    a SectionMonitorChainBuilder that is sectioned by the specified key path

    +
    +
    +
    +
  • +
  • +
    + + + + sectionBy(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a SectionMonitorChainBuilder with the key path to use to group ListMonitor objects into sections, and a closure to transform the value for the key path to an appropriate section name

    +
    +

    Important

    + Some utilities (such as ListMonitors) may keep SectionBys in memory and may thus introduce retain cycles if reference captures are not handled properly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public func sectionBy<T>(_ sectionKeyPath: KeyPath<D, ValueContainer<D>.Required<T>>, _ sectionIndexTransformer: @escaping (_ sectionName: String?) -> String?) -> SectionMonitorChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionKeyPath + + +
    +

    the KeyPath to use to group the objects into sections

    +
    +
    + + sectionIndexTransformer + + +
    +

    a closure to transform the value for the key path to an appropriate section name

    +
    +
    +
    +
    +

    Return Value

    +

    a SectionMonitorChainBuilder that is sectioned by the specified key path

    +
    +
    +
    +
  • +
  • +
    + + + + sectionBy(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a SectionMonitorChainBuilder with the key path to use to group ListMonitor objects into sections, and a closure to transform the value for the key path to an appropriate section name

    +
    +

    Important

    + Some utilities (such as ListMonitors) may keep SectionBys in memory and may thus introduce retain cycles if reference captures are not handled properly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public func sectionBy<T>(_ sectionKeyPath: KeyPath<D, ValueContainer<D>.Optional<T>>, _ sectionIndexTransformer: @escaping (_ sectionName: String?) -> String?) -> SectionMonitorChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionKeyPath + + +
    +

    the KeyPath to use to group the objects into sections

    +
    +
    + + sectionIndexTransformer + + +
    +

    a closure to transform the value for the key path to an appropriate section name

    +
    +
    +
    +
    +

    Return Value

    +

    a SectionMonitorChainBuilder that is sectioned by the specified key path

    +
    +
    +
    +
  • +
  • +
    + + + + sectionBy(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a SectionMonitorChainBuilder with the key path to use to group ListMonitor objects into sections, and a closure to transform the value for the key path to an appropriate section name

    +
    +

    Important

    + Some utilities (such as ListMonitors) may keep SectionBys in memory and may thus introduce retain cycles if reference captures are not handled properly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public func sectionBy<T>(_ sectionKeyPath: KeyPath<D, TransformableContainer<D>.Required<T>>, _ sectionIndexTransformer: @escaping (_ sectionName: String?) -> String?) -> SectionMonitorChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionKeyPath + + +
    +

    the KeyPath to use to group the objects into sections

    +
    +
    + + sectionIndexTransformer + + +
    +

    a closure to transform the value for the key path to an appropriate section name

    +
    +
    +
    +
    +

    Return Value

    +

    a SectionMonitorChainBuilder that is sectioned by the specified key path

    +
    +
    +
    +
  • +
  • +
    + + + + sectionBy(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a SectionMonitorChainBuilder with the key path to use to group ListMonitor objects into sections, and a closure to transform the value for the key path to an appropriate section name

    +
    +

    Important

    + Some utilities (such as ListMonitors) may keep SectionBys in memory and may thus introduce retain cycles if reference captures are not handled properly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public func sectionBy<T>(_ sectionKeyPath: KeyPath<D, TransformableContainer<D>.Optional<T>>, _ sectionIndexTransformer: @escaping (_ sectionName: String?) -> String?) -> SectionMonitorChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionKeyPath + + +
    +

    the KeyPath to use to group the objects into sections

    +
    +
    + + sectionIndexTransformer + + +
    +

    a closure to transform the value for the key path to an appropriate section name

    +
    +
    +
    +
    +

    Return Value

    +

    a SectionMonitorChainBuilder that is sectioned by the specified key path

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Structs/GroupBy.html b/docs/Structs/GroupBy.html new file mode 100644 index 0000000..e6847d5 --- /dev/null +++ b/docs/Structs/GroupBy.html @@ -0,0 +1,1345 @@ + + + + GroupBy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

GroupBy

+
+
+
public struct GroupBy<D> : GroupByClause, QueryClause, Hashable where D : DynamicObject
+ +
+
+

The GroupBy clause specifies that the result of a query be grouped accoording to the specified key path.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes a GroupBy clause with an empty list of key path strings

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a GroupBy clause with a list of key path strings

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ keyPath: KeyPathString, _ keyPaths: KeyPathString...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    a key path string to group results with

    +
    +
    + + keyPaths + + +
    +

    a series of key path strings to group results with

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a GroupBy clause with a list of key path strings

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ keyPaths: [KeyPathString])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPaths + + +
    +

    a list of key path strings to group results with

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = D
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + keyPaths + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let keyPaths: [KeyPathString]
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: GroupBy, rhs: GroupBy) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a GroupBy clause with a key path

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ keyPath: KeyPath<D, T>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    a key path to group results with

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a GroupBy clause with a key path

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ keyPath: KeyPath<D, ValueContainer<D>.Required<T>>) where T : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    a key path to group results with

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a GroupBy clause with a key path

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<T>>) where T : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    a key path to group results with

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a GroupBy clause with a key path

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ keyPath: KeyPath<D, TransformableContainer<D>.Required<T>>) where T : NSCoding, T : NSCopying
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    a key path to group results with

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a GroupBy clause with a key path

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ keyPath: KeyPath<D, TransformableContainer<D>.Optional<T>>) where T : NSCoding, T : NSCopying
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    a key path to group results with

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Structs/Into.html b/docs/Structs/Into.html new file mode 100644 index 0000000..f008511 --- /dev/null +++ b/docs/Structs/Into.html @@ -0,0 +1,1145 @@ + + + + Into Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Into

+
+
+
public struct Into<D> : Hashable where D : DynamicObject
+ +
+
+

An Into clause contains the destination entity and destination persistent store for a create(...) method. A common usage is to just indicate the entity:

+
let person = transaction.create(Into<MyPersonEntity>())
+
+ +

For cases where multiple NSPersistentStores contain the same entity, the destination configuration’s name needs to be specified as well:

+
let person = transaction.create(Into<MyPersonEntity>("Configuration1"))
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + entityClass + +
    +
    +
    +
    +
    +
    +

    The associated NSManagedObject or CoreStoreObject entity class

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let entityClass: D.Type
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    +

    The NSPersistentStore configuration name to associate objects from. +May contain a String to pertain to a named configuration, or nil to pertain to the default configuration

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let configuration: ModelConfiguration
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes an Into clause.

    +
    let person = transaction.create(Into<MyPersonEntity>())
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes an Into clause with the specified entity type. This is useful for querying a subclass while binding the generic type with a base class.

    +
    let person = transaction.create(Into<MyPersonEntity>(MyEmployeeEntity.self))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ entity: D.Type)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the NSManagedObject or CoreStoreObject type to be created

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes an Into clause with the specified configuration.

    +
    let person = transaction.create(Into<MyPersonEntity>("Configuration1"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ configuration: ModelConfiguration)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + configuration + + +
    +

    the NSPersistentStore configuration name to associate the object to. This parameter is required if multiple configurations contain the created NSManagedObject‘s or CoreStoreObject’s entity type. Set to nil to use the default configuration.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes an Into clause with the specified entity type and configuration. This is useful for querying a subclass while binding the generic type with a base class.

    +
    let person = transaction.create(Into<MyPersonEntity>(MyEmployeeEntity.self, "Configuration1"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ entity: D.Type, _ configuration: ModelConfiguration)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + entity + + +
    +

    the NSManagedObject or CoreStoreObject type to be created

    +
    +
    + + configuration + + +
    +

    the NSPersistentStore configuration name to associate the object to. This parameter is required if multiple configurations contain the created NSManagedObject‘s or CoreStoreObject’s entity type. Set to nil to use the default configuration.

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == <U, V>(lhs: Into<U>, rhs: Into<V>) -> Bool where U : DynamicObject, V : DynamicObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Structs/LocalStorageOptions.html b/docs/Structs/LocalStorageOptions.html new file mode 100644 index 0000000..7969272 --- /dev/null +++ b/docs/Structs/LocalStorageOptions.html @@ -0,0 +1,1044 @@ + + + + LocalStorageOptions Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

LocalStorageOptions

+
+
+
public struct LocalStorageOptions : OptionSet, ExpressibleByNilLiteral
+ +
+
+

The LocalStorageOptions provides settings that tells the DataStack how to setup the persistent store for LocalStorage implementers.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + none + +
    +
    +
    +
    +
    +
    +

    Tells the DataStack that the store should not be migrated or recreated, and should simply fail on model mismatch

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let none: LocalStorageOptions
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Tells the DataStack to delete and recreate the store on model mismatch, otherwise exceptions will be thrown on failure instead

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let recreateStoreOnModelMismatch: LocalStorageOptions
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Tells the DataStack to prevent progressive migrations for the store

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let preventProgressiveMigration: LocalStorageOptions
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Tells the DataStack to allow lightweight migration for the store when added synchronously

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let allowSynchronousLightweightMigration: LocalStorageOptions
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + init(rawValue:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(rawValue: Int)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + rawValue + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let rawValue: Int
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + init(nilLiteral:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(nilLiteral: ())
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Structs/MigrationChain.html b/docs/Structs/MigrationChain.html new file mode 100644 index 0000000..e6d8e14 --- /dev/null +++ b/docs/Structs/MigrationChain.html @@ -0,0 +1,1253 @@ + + + + MigrationChain Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

MigrationChain

+
+
+
public struct MigrationChain : ExpressibleByNilLiteral, ExpressibleByStringLiteral, ExpressibleByDictionaryLiteral, ExpressibleByArrayLiteral, Equatable
+ +
+
+

A MigrationChain indicates the sequence of model versions to be used as the order for progressive migrations. This is typically passed to the SchemaHistory or the DataStack initializer and will be applied to all stores added to the DataStack with addStorage(...) and its variants.

+ +

Initializing with empty values (either nil, [], or [:]) instructs the DataStack to use the .xcdatamodel’s current version as the final version, and to disable progressive migrations:

+
let dataStack = DataStack(migrationChain: nil)
+
+ +

This means that the mapping model will be computed from the store’s version straight to the DataStack‘s model version. +To support progressive migrations, specify the linear order of versions:

+
let dataStack = DataStack(migrationChain:
+   ["MyAppModel", "MyAppModelV2", "MyAppModelV3", "MyAppModelV4"])
+
+ +

or for more complex migration paths, a version tree that maps the key-values to the source-destination versions:

+
let dataStack = DataStack(migrationChain: [
+    "MyAppModel": "MyAppModelV3",
+    "MyAppModelV2": "MyAppModelV4",
+    "MyAppModelV3": "MyAppModelV4"
+])
+
+ +

This allows for different migration paths depending on the starting version. The example above resolves to the following paths:

+ +
    +
  • MyAppModel-MyAppModelV3-MyAppModelV4
  • +
  • MyAppModelV2-MyAppModelV4
  • +
  • MyAppModelV3-MyAppModelV4
  • +
+ +

The MigrationChain is validated when passed to the DataStack and unless it is empty, will raise an assertion if any of the following conditions are met:

+ +
    +
  • a version appears twice in an array
  • +
  • a version appears twice as a key in a dictionary literal
  • +
  • a loop is found in any of the paths
  • +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes the MigrationChain with empty values, which instructs the DataStack to use the .xcdatamodel’s current version as the final version, and to disable progressive migrations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes the MigrationChain with a single model version, which instructs the DataStack to use the the specified version as the final version, and to disable progressive migrations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ value: String)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes the MigrationChain with a linear order of versions, which becomes the order of the DataStack‘s progressive migrations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ elements: T) where T : Collection, T.Element == String
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes the MigrationChain with a version tree, which becomes the order of the DataStack‘s progressive migrations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ elements: [(String, String)])
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes the MigrationChain with a version tree, which becomes the order of the DataStack‘s progressive migrations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ dictionary: [String : String])
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + init(nilLiteral:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(nilLiteral: ())
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + init(stringLiteral:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(stringLiteral value: String)
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(unicodeScalarLiteral value: String)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(dictionaryLiteral elements: (String, String)...)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + init(arrayLiteral:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(arrayLiteral elements: String...)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: MigrationChain, rhs: MigrationChain) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Structs/OrderBy.html b/docs/Structs/OrderBy.html new file mode 100644 index 0000000..ac392a3 --- /dev/null +++ b/docs/Structs/OrderBy.html @@ -0,0 +1,1278 @@ + + + + OrderBy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

OrderBy

+
+
+
public struct OrderBy<D> : OrderByClause, FetchClause, QueryClause, DeleteClause, Hashable where D : DynamicObject
+ +
+
+

The OrderBy clause specifies the sort order for results for a fetch or a query.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + +(_:_:) + +
    +
    +
    +
    +
    +
    +

    Combines two OrderBy sort descriptors together

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func + (left: OrderBy, right: OrderBy) -> OrderBy
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + +=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Combines two OrderBy sort descriptors together and stores the result to the left operand

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func += (left: inout OrderBy, right: OrderBy)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes a OrderBy clause with an empty list of sort descriptors

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a OrderBy clause with a single sort descriptor

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ sortDescriptor: NSSortDescriptor)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sortDescriptor + + +
    +

    a NSSortDescriptor

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a OrderBy clause with a list of sort descriptors

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ sortDescriptors: [NSSortDescriptor])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sortDescriptors + + +
    +

    a series of NSSortDescriptors

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a OrderBy clause with a series of SortKeys

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ sortKeys: [SortKey])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sortKey + + +
    +

    a series of SortKeys

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a OrderBy clause with a series of SortKeys

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ sortKey: SortKey, _ sortKeys: SortKey...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sortKey + + +
    +

    a single SortKey

    +
    +
    + + sortKeys + + +
    +

    a series of SortKeys

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = D
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + sortDescriptors + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let sortDescriptors: [NSSortDescriptor]
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: OrderBy, rhs: OrderBy) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + SortKey + +
    +
    +
    +
    +
    +
    +

    The SortKey is passed to the OrderBy clause to indicate the sort keys and their sort direction.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct SortKey
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Structs/OrderBy/SortKey.html b/docs/Structs/OrderBy/SortKey.html new file mode 100644 index 0000000..6b206e9 --- /dev/null +++ b/docs/Structs/OrderBy/SortKey.html @@ -0,0 +1,1206 @@ + + + + SortKey Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SortKey

+
+
+
public struct SortKey
+ +
+
+

The SortKey is passed to the OrderBy clause to indicate the sort keys and their sort direction.

+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + ascending(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the KeyPathString should be sorted in ascending order

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ascending(_ keyPath: KeyPathString) -> SortKey
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + descending(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the KeyPathString should be sorted in descending order

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func descending(_ keyPath: KeyPathString) -> SortKey
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ascending(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the KeyPathString should be sorted in ascending order

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ascending<T>(_ keyPath: KeyPath<D, T>) -> SortKey
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + descending(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the KeyPathString should be sorted in descending order

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func descending<T>(_ keyPath: KeyPath<D, T>) -> SortKey
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ascending(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the KeyPathString should be sorted in ascending order

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ascending<T>(_ attribute: KeyPath<D, ValueContainer<D>.Required<T>>) -> SortKey where T : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ascending(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the KeyPathString should be sorted in ascending order

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ascending<T>(_ attribute: KeyPath<D, ValueContainer<D>.Optional<T>>) -> SortKey where T : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ascending(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the KeyPathString should be sorted in ascending order

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ascending<T>(_ attribute: KeyPath<D, TransformableContainer<D>.Required<T>>) -> SortKey where T : NSCoding, T : NSCopying
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ascending(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the KeyPathString should be sorted in ascending order

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ascending<T>(_ attribute: KeyPath<D, TransformableContainer<D>.Optional<T>>) -> SortKey where T : NSCoding, T : NSCopying
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + descending(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the KeyPathString should be sorted in descending order

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func descending<T>(_ attribute: KeyPath<D, ValueContainer<D>.Required<T>>) -> SortKey where T : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + descending(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the KeyPathString should be sorted in descending order

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func descending<T>(_ attribute: KeyPath<D, ValueContainer<D>.Optional<T>>) -> SortKey where T : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + descending(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the KeyPathString should be sorted in descending order

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func descending<T>(_ attribute: KeyPath<D, TransformableContainer<D>.Required<T>>) -> SortKey where T : NSCoding, T : NSCopying
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + descending(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the KeyPathString should be sorted in descending order

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func descending<T>(_ attribute: KeyPath<D, TransformableContainer<D>.Optional<T>>) -> SortKey where T : NSCoding, T : NSCopying
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ascending(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the KeyPathString should be sorted in ascending order

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ascending<K>(_ attribute: (D) -> K) -> OrderBy<D>.SortKey where K : DynamicKeyPath
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + descending(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the KeyPathString should be sorted in descending order

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func descending<K>(_ attribute: (D) -> K) -> OrderBy<D>.SortKey where K : DynamicKeyPath
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Structs/PartialObject.html b/docs/Structs/PartialObject.html new file mode 100644 index 0000000..b7c70be --- /dev/null +++ b/docs/Structs/PartialObject.html @@ -0,0 +1,1307 @@ + + + + PartialObject Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

PartialObject

+
+
+
public struct PartialObject<O> where O : CoreStoreObject
+ +
+
+

A PartialObject is only used when overriding getters and setters for CoreStoreObject properties. Custom getters and setters are implemented as a closure that overrides the default property getter/setter. The closure receives a PartialObject<O>, which acts as a fast, type-safe KVC interface for CoreStoreObject. The reason a CoreStoreObject instance is not passed directly is because the Core Data runtime is not aware of CoreStoreObject properties’ static typing, and so loading those info everytime KVO invokes this accessor method incurs a heavy performance hit (especially in KVO-heavy operations such as ListMonitor observing.) When accessing the property value from PartialObject<O>, make sure to use PartialObject<O>.persistentValue(for:) instead of PartialObject<O>.value(for:), which would unintentionally execute the same closure again recursively.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + completeObject() + +
    +
    +
    +
    +
    +
    +

    Returns a the actual CoreStoreObject instance for the receiver.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func completeObject() -> O
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + value(for:) + +
    +
    +
    +
    +
    +
    +

    Returns the value for the property identified by a given key.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func value<V>(for property: (O) -> ValueContainer<O>.Required<V>) -> V where V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + setValue(_:for:) + +
    +
    +
    +
    +
    +
    +

    Sets the property of the receiver specified by a given key to a given value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func setValue<V>(_ value: V, for property: (O) -> ValueContainer<O>.Required<V>) where V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + primitiveValue(for:) + +
    +
    +
    +
    +
    +
    +

    Returns the value for the specified property from the managed object’s private internal storage.

    + +

    This method does not invoke the access notification methods (willAccessValue(forKey:) and didAccessValue(forKey:)). This method is used primarily by subclasses that implement custom accessor methods that need direct access to the receiver’s private storage.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func primitiveValue<V>(for property: (O) -> ValueContainer<O>.Required<V>) -> V where V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Sets in the object’s private internal storage the value of a given property.

    + +

    Sets in the receiver’s private internal storage the value of the property specified by key to value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func setPrimitiveValue<V>(_ value: V, for property: (O) -> ValueContainer<O>.Required<V>) where V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + value(for:) + +
    +
    +
    +
    +
    +
    +

    Returns the value for the property identified by a given key.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func value<V>(for property: (O) -> ValueContainer<O>.Optional<V>) -> V? where V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + setValue(_:for:) + +
    +
    +
    +
    +
    +
    +

    Sets the property of the receiver specified by a given key to a given value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func setValue<V>(_ value: V?, for property: (O) -> ValueContainer<O>.Optional<V>) where V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + primitiveValue(for:) + +
    +
    +
    +
    +
    +
    +

    Returns the value for the specified property from the managed object’s private internal storage.

    + +

    This method does not invoke the access notification methods (willAccessValue(forKey:) and didAccessValue(forKey:)). This method is used primarily by subclasses that implement custom accessor methods that need direct access to the receiver’s private storage.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func primitiveValue<V>(for property: (O) -> ValueContainer<O>.Optional<V>) -> V? where V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Sets in the object’s private internal storage the value of a given property.

    + +

    Sets in the receiver’s private internal storage the value of the property specified by key to value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func setPrimitiveValue<V>(_ value: V?, for property: (O) -> ValueContainer<O>.Optional<V>) where V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + value(for:) + +
    +
    +
    +
    +
    +
    +

    Returns the value for the property identified by a given key.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func value<V>(for property: (O) -> TransformableContainer<O>.Required<V>) -> V where V : NSCoding, V : NSCopying
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + setValue(_:for:) + +
    +
    +
    +
    +
    +
    +

    Sets the property of the receiver specified by a given key to a given value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func setValue<V>(_ value: V, for property: (O) -> TransformableContainer<O>.Required<V>) where V : NSCoding, V : NSCopying
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + primitiveValue(for:) + +
    +
    +
    +
    +
    +
    +

    Returns the value for the specified property from the managed object’s private internal storage.

    + +

    This method does not invoke the access notification methods (willAccessValue(forKey:) and didAccessValue(forKey:)). This method is used primarily by subclasses that implement custom accessor methods that need direct access to the receiver’s private storage.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func primitiveValue<V>(for property: (O) -> TransformableContainer<O>.Required<V>) -> V where V : NSCoding, V : NSCopying
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Sets in the object’s private internal storage the value of a given property.

    + +

    Sets in the receiver’s private internal storage the value of the property specified by key to value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func setPrimitiveValue<V>(_ value: V, for property: (O) -> TransformableContainer<O>.Required<V>) where V : NSCoding, V : NSCopying
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + value(for:) + +
    +
    +
    +
    +
    +
    +

    Returns the value for the property identified by a given key.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func value<V>(for property: (O) -> TransformableContainer<O>.Optional<V>) -> V? where V : NSCoding, V : NSCopying
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + setValue(_:for:) + +
    +
    +
    +
    +
    +
    +

    Sets the property of the receiver specified by a given key to a given value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func setValue<V>(_ value: V?, for property: (O) -> TransformableContainer<O>.Optional<V>) where V : NSCoding, V : NSCopying
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + primitiveValue(for:) + +
    +
    +
    +
    +
    +
    +

    Returns the value for the specified property from the managed object’s private internal storage.

    + +

    This method does not invoke the access notification methods (willAccessValue(forKey:) and didAccessValue(forKey:)). This method is used primarily by subclasses that implement custom accessor methods that need direct access to the receiver’s private storage.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func primitiveValue<V>(for property: (O) -> TransformableContainer<O>.Optional<V>) -> V? where V : NSCoding, V : NSCopying
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Sets in the object’s private internal storage the value of a given property.

    + +

    Sets in the receiver’s private internal storage the value of the property specified by key to value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func setPrimitiveValue<V>(_ value: V?, for property: (O) -> TransformableContainer<O>.Optional<V>) where V : NSCoding, V : NSCopying
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Structs/QueryChainBuilder.html b/docs/Structs/QueryChainBuilder.html new file mode 100644 index 0000000..7c2bcd5 --- /dev/null +++ b/docs/Structs/QueryChainBuilder.html @@ -0,0 +1,1812 @@ + + + + QueryChainBuilder Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

QueryChainBuilder

+
+
+
public struct QueryChainBuilder<D, R> : QueryChainableBuilderType where D : DynamicObject, R : SelectResultType
+ +
+
+

The fetch builder type used for a queries. A QueryChainBuilder is created from a From clause and then a select(...) chain.

+
let averageAdultAge = dataStack.queryValue(
+    From<MyPersonEntity>()
+        .select(Int.self, .average(\.age))
+        .where(\.age > 18)
+)
+
+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = D
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ResultType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ResultType = R
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + from + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var from: From<D>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + select + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var select: Select<D, R>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + queryClauses + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var queryClauses: [QueryClause]
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

From

+
+
+
    +
  • +
    + + + + where(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a Where clause to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func `where`(_ clause: Where<D>) -> QueryChainBuilder<D, R>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clause + + +
    +

    a Where clause to add to the query builder

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the Where clause

    +
    +
    +
    +
  • +
  • +
    + + + + where(format:_:) + +
    +
    +
    +
    +
    +
    +

    Adds a Where clause to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func `where`(format: String, _ args: Any...) -> QueryChainBuilder<D, R>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + format + + +
    +

    the format string for the predicate

    +
    +
    + + args + + +
    +

    the arguments for format

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the Where clause

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Adds a Where clause to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func `where`(format: String, argumentArray: [Any]?) -> QueryChainBuilder<D, R>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + format + + +
    +

    the format string for the predicate

    +
    +
    + + argumentArray + + +
    +

    the arguments for format

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the Where clause

    +
    +
    +
    +
  • +
  • +
    + + + + orderBy(_:_:) + +
    +
    +
    +
    +
    +
    +

    Adds an OrderBy clause to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func orderBy(_ sortKey: OrderBy<D>.SortKey, _ sortKeys: OrderBy<D>.SortKey...) -> QueryChainBuilder<D, R>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sortKey + + +
    +

    a single SortKey

    +
    +
    + + sortKeys + + +
    +

    a series of other SortKeys

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the OrderBy clause

    +
    +
    +
    +
  • +
  • +
    + + + + tweak(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a Tweak clause to the QueryChainBuilder with a closure where the NSFetchRequest may be configured

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func tweak(_ fetchRequest: @escaping (NSFetchRequest<NSFetchRequestResult>) -> Void) -> QueryChainBuilder<D, R>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + fetchRequest + + +
    +

    the block to customize the NSFetchRequest

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the Tweak clause

    +
    +
    +
    +
  • +
  • +
    + + + + groupBy(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a GroupBy clause to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func groupBy(_ clause: GroupBy<D>) -> QueryChainBuilder<D, R>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clause + + +
    +

    a GroupBy clause to add to the query builder

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the GroupBy clause

    +
    +
    +
    +
  • +
  • +
    + + + + groupBy(_:_:) + +
    +
    +
    +
    +
    +
    +

    Adds a GroupBy clause to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func groupBy(_ keyPath: KeyPathString, _ keyPaths: KeyPathString...) -> QueryChainBuilder<D, R>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    a key path to group the query results with

    +
    +
    + + keyPaths + + +
    +

    other key paths to group the query results with

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the GroupBy clause

    +
    +
    +
    +
  • +
  • +
    + + + + groupBy(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a GroupBy clause to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func groupBy(_ keyPaths: [KeyPathString]) -> QueryChainBuilder<D, R>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPaths + + +
    +

    a series of key paths to group the query results with

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the GroupBy clause

    +
    +
    +
    +
  • +
  • +
    + + + + appending(_:) + +
    +
    +
    +
    +
    +
    +

    Appends a QueryClause to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func appending(_ clause: QueryClause) -> QueryChainBuilder<D, R>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clause + + +
    +

    the QueryClause to add to the QueryChainBuilder

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the QueryClause

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Appends a series of QueryClauses to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func appending<S>(contentsOf clauses: S) -> QueryChainBuilder<D, R> where S : Sequence, S.Element == QueryClause
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauses + + +
    +

    the QueryClauses to add to the QueryChainBuilder

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the QueryClauses

    +
    +
    +
    +
  • +
+
+
+
+ + + +

From

+
+
+
    +
  • +
    + + + + groupBy(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a GroupBy clause to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func groupBy<T>(_ keyPath: KeyPath<D, T>) -> QueryChainBuilder<D, R>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    a key path to group the query results with

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the GroupBy clause

    +
    +
    +
    +
  • +
+
+
+
+ + + +

From

+
+
+
    +
  • +
    + + + + where(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a Where clause to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func `where`<T>(_ clause: (D) -> T) -> QueryChainBuilder<D, R> where T : AnyWhereClause
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clause + + +
    +

    a Where clause to add to the query builder

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the Where clause

    +
    +
    +
    +
  • +
  • +
    + + + + groupBy(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a GroupBy clause to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func groupBy<T>(_ keyPath: KeyPath<D, ValueContainer<D>.Required<T>>) -> QueryChainBuilder<D, R> where T : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    a key path to group the query results with

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the GroupBy clause

    +
    +
    +
    +
  • +
  • +
    + + + + groupBy(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a GroupBy clause to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func groupBy<T>(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<T>>) -> QueryChainBuilder<D, R> where T : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    a key path to group the query results with

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the GroupBy clause

    +
    +
    +
    +
  • +
  • +
    + + + + groupBy(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a GroupBy clause to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func groupBy<T>(_ keyPath: KeyPath<D, TransformableContainer<D>.Required<T>>) -> QueryChainBuilder<D, R> where T : NSCoding, T : NSCopying
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    a key path to group the query results with

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the GroupBy clause

    +
    +
    +
    +
  • +
  • +
    + + + + groupBy(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a GroupBy clause to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func groupBy<T>(_ keyPath: KeyPath<D, TransformableContainer<D>.Optional<T>>) -> QueryChainBuilder<D, R> where T : NSCoding, T : NSCopying
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    a key path to group the query results with

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the GroupBy clause

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Structs/SectionBy.html b/docs/Structs/SectionBy.html new file mode 100644 index 0000000..d6fcae0 --- /dev/null +++ b/docs/Structs/SectionBy.html @@ -0,0 +1,1508 @@ + + + + SectionBy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SectionBy

+
+
+
@available(OSX 10.12, *)
+public struct SectionBy<D> where D : DynamicObject
+ +
+
+

The SectionBy clause indicates the key path to use to group the ListMonitor objects into sections. An optional closure can also be provided to transform the value into an appropriate section name:

+
let monitor = CoreStore.monitorSectionedList(
+    From<Person>(),
+    SectionBy("age") { "Age \($0)" },
+    OrderBy(.ascending("lastName"))
+)
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a SectionBy clause with the key path to use to group ListMonitor objects into sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ sectionKeyPath: KeyPathString)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sectionKeyPath + + +
    +

    the key path to use to group the objects into sections

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a SectionBy clause with the key path to use to group ListMonitor objects into sections, and a closure to transform the value for the key path to an appropriate section name

    +
    +

    Important

    + Some utilities (such as ListMonitors) may keep SectionBys in memory and may thus introduce retain cycles if reference captures are not handled properly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ sectionKeyPath: KeyPathString, _ sectionIndexTransformer: @escaping (_ sectionName: String?) -> String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionKeyPath + + +
    +

    the key path to use to group the objects into sections

    +
    +
    + + sectionIndexTransformer + + +
    +

    a closure to transform the value for the key path to an appropriate section name

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a SectionBy clause with the key path to use to group ListMonitor objects into sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ sectionKeyPath: KeyPath<D, T>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sectionKeyPath + + +
    +

    the key path to use to group the objects into sections

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a SectionBy clause with the key path to use to group ListMonitor objects into sections, and a closure to transform the value for the key path to an appropriate section name

    +
    +

    Important

    + Some utilities (such as ListMonitors) may keep SectionBys in memory and may thus introduce retain cycles if reference captures are not handled properly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ sectionKeyPath: KeyPath<D, T>, _ sectionIndexTransformer: @escaping (_ sectionName: String?) -> String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionKeyPath + + +
    +

    the key path to use to group the objects into sections

    +
    +
    + + sectionIndexTransformer + + +
    +

    a closure to transform the value for the key path to an appropriate section name

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a SectionBy clause with the key path to use to group ListMonitor objects into sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ sectionKeyPath: KeyPath<D, ValueContainer<D>.Required<T>>) where T : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sectionKeyPath + + +
    +

    the key path to use to group the objects into sections

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a SectionBy clause with the key path to use to group ListMonitor objects into sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ sectionKeyPath: KeyPath<D, ValueContainer<D>.Optional<T>>) where T : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sectionKeyPath + + +
    +

    the key path to use to group the objects into sections

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a SectionBy clause with the key path to use to group ListMonitor objects into sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ sectionKeyPath: KeyPath<D, TransformableContainer<D>.Required<T>>) where T : NSCoding, T : NSCopying
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sectionKeyPath + + +
    +

    the key path to use to group the objects into sections

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a SectionBy clause with the key path to use to group ListMonitor objects into sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ sectionKeyPath: KeyPath<D, TransformableContainer<D>.Optional<T>>) where T : NSCoding, T : NSCopying
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sectionKeyPath + + +
    +

    the key path to use to group the objects into sections

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a SectionBy clause with the key path to use to group ListMonitor objects into sections, and a closure to transform the value for the key path to an appropriate section name

    +
    +

    Important

    + Some utilities (such as ListMonitors) may keep SectionBys in memory and may thus introduce retain cycles if reference captures are not handled properly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ sectionKeyPath: KeyPath<D, ValueContainer<D>.Required<T>>, _ sectionIndexTransformer: @escaping (_ sectionName: String?) -> String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionKeyPath + + +
    +

    the key path to use to group the objects into sections

    +
    +
    + + sectionIndexTransformer + + +
    +

    a closure to transform the value for the key path to an appropriate section name

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a SectionBy clause with the key path to use to group ListMonitor objects into sections, and a closure to transform the value for the key path to an appropriate section name

    +
    +

    Important

    + Some utilities (such as ListMonitors) may keep SectionBys in memory and may thus introduce retain cycles if reference captures are not handled properly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ sectionKeyPath: KeyPath<D, ValueContainer<D>.Optional<T>>, _ sectionIndexTransformer: @escaping (_ sectionName: String?) -> String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionKeyPath + + +
    +

    the key path to use to group the objects into sections

    +
    +
    + + sectionIndexTransformer + + +
    +

    a closure to transform the value for the key path to an appropriate section name

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a SectionBy clause with the key path to use to group ListMonitor objects into sections, and a closure to transform the value for the key path to an appropriate section name

    +
    +

    Important

    + Some utilities (such as ListMonitors) may keep SectionBys in memory and may thus introduce retain cycles if reference captures are not handled properly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ sectionKeyPath: KeyPath<D, TransformableContainer<D>.Required<T>>, _ sectionIndexTransformer: @escaping (_ sectionName: String?) -> String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionKeyPath + + +
    +

    the key path to use to group the objects into sections

    +
    +
    + + sectionIndexTransformer + + +
    +

    a closure to transform the value for the key path to an appropriate section name

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a SectionBy clause with the key path to use to group ListMonitor objects into sections, and a closure to transform the value for the key path to an appropriate section name

    +
    +

    Important

    + Some utilities (such as ListMonitors) may keep SectionBys in memory and may thus introduce retain cycles if reference captures are not handled properly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ sectionKeyPath: KeyPath<D, TransformableContainer<D>.Optional<T>>, _ sectionIndexTransformer: @escaping (_ sectionName: String?) -> String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionKeyPath + + +
    +

    the key path to use to group the objects into sections

    +
    +
    + + sectionIndexTransformer + + +
    +

    a closure to transform the value for the key path to an appropriate section name

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Structs/SectionMonitorChainBuilder.html b/docs/Structs/SectionMonitorChainBuilder.html new file mode 100644 index 0000000..c0e2dce --- /dev/null +++ b/docs/Structs/SectionMonitorChainBuilder.html @@ -0,0 +1,1339 @@ + + + + SectionMonitorChainBuilder Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SectionMonitorChainBuilder

+
+
+
@available(OSX 10.12, *)
+public struct SectionMonitorChainBuilder<D> : SectionMonitorBuilderType where D : DynamicObject
+ +
+
+

The fetch builder type used for a sectioned ListMonitor. A SectionMonitorChainBuilder is created from a From clause and then a sectionBy(...) chain.

+
let monitor = transaction.monitorSectionedList(
+    From<MyPersonEntity>()
+        .sectionBy(\.age, { "\($0!) years old" })
+        .where(\.age > 18)
+        .orderBy(.ascending(\.age))
+)
+
+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + from + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var from: From<D>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + sectionBy + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var sectionBy: SectionBy<D>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchClauses + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var fetchClauses: [FetchClause]
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

From

+
+
+
    +
  • +
    + + + + where(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a Where clause to the SectionMonitorChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func `where`(_ clause: Where<D>) -> SectionMonitorChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clause + + +
    +

    a Where clause to add to the fetch builder

    +
    +
    +
    +
    +

    Return Value

    +

    a new SectionMonitorChainBuilder containing the Where clause

    +
    +
    +
    +
  • +
  • +
    + + + + where(format:_:) + +
    +
    +
    +
    +
    +
    +

    Adds a Where clause to the SectionMonitorChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func `where`(format: String, _ args: Any...) -> SectionMonitorChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + format + + +
    +

    the format string for the predicate

    +
    +
    + + args + + +
    +

    the arguments for format

    +
    +
    +
    +
    +

    Return Value

    +

    a new SectionMonitorChainBuilder containing the Where clause

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Adds a Where clause to the SectionMonitorChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func `where`(format: String, argumentArray: [Any]?) -> SectionMonitorChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + format + + +
    +

    the format string for the predicate

    +
    +
    + + argumentArray + + +
    +

    the arguments for format

    +
    +
    +
    +
    +

    Return Value

    +

    a new SectionMonitorChainBuilder containing the Where clause

    +
    +
    +
    +
  • +
  • +
    + + + + orderBy(_:_:) + +
    +
    +
    +
    +
    +
    +

    Adds an OrderBy clause to the SectionMonitorChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func orderBy(_ sortKey: OrderBy<D>.SortKey, _ sortKeys: OrderBy<D>.SortKey...) -> SectionMonitorChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sortKey + + +
    +

    a single SortKey

    +
    +
    + + sortKeys + + +
    +

    a series of other SortKeys

    +
    +
    +
    +
    +

    Return Value

    +

    a new SectionMonitorChainBuilder containing the OrderBy clause

    +
    +
    +
    +
  • +
  • +
    + + + + tweak(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a Tweak clause to the SectionMonitorChainBuilder with a closure where the NSFetchRequest may be configured

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func tweak(_ fetchRequest: @escaping (NSFetchRequest<NSFetchRequestResult>) -> Void) -> SectionMonitorChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + fetchRequest + + +
    +

    the block to customize the NSFetchRequest

    +
    +
    +
    +
    +

    Return Value

    +

    a new SectionMonitorChainBuilder containing the Tweak clause

    +
    +
    +
    +
  • +
  • +
    + + + + appending(_:) + +
    +
    +
    +
    +
    +
    +

    Appends a QueryClause to the SectionMonitorChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func appending(_ clause: FetchClause) -> SectionMonitorChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clause + + +
    +

    the QueryClause to add to the SectionMonitorChainBuilder

    +
    +
    +
    +
    +

    Return Value

    +

    a new SectionMonitorChainBuilder containing the QueryClause

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Appends a series of QueryClauses to the SectionMonitorChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func appending<S>(contentsOf clauses: S) -> SectionMonitorChainBuilder<D> where S : Sequence, S.Element == FetchClause
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauses + + +
    +

    the QueryClauses to add to the SectionMonitorChainBuilder

    +
    +
    +
    +
    +

    Return Value

    +

    a new SectionMonitorChainBuilder containing the QueryClauses

    +
    +
    +
    +
  • +
+
+
+
+ + + +

From

+
+
+
    +
  • +
    + + + + where(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a Where clause to the SectionMonitorChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func `where`<T>(_ clause: (D) -> T) -> SectionMonitorChainBuilder<D> where T : AnyWhereClause
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clause + + +
    +

    a Where clause to add to the fetch builder

    +
    +
    +
    +
    +

    Return Value

    +

    a new SectionMonitorChainBuilder containing the Where clause

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Structs/Select.html b/docs/Structs/Select.html new file mode 100644 index 0000000..bb31440 --- /dev/null +++ b/docs/Structs/Select.html @@ -0,0 +1,1422 @@ + + + + Select Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Select

+
+
+
public struct Select<D, T> : SelectClause, Hashable where D : DynamicObject, T : SelectResultType
+ +
+
+

The Select clause indicates the attribute / aggregate value to be queried. The generic type is a SelectResultType, and will be used as the return type for the query.

+ +

You can bind the return type by specializing the initializer:

+
let maximumAge = CoreStore.queryValue(
+    From<MyPersonEntity>(),
+    Select<Int>(.maximum("age"))
+)
+
+ +

or by casting the type of the return value:

+
let maximumAge: Int = CoreStore.queryValue(
+    From<MyPersonEntity>(),
+    Select(.maximum("age"))
+)
+
+ +

Valid return types depend on the query:

+ +
    +
  • for queryValue(...) methods: + +
  • +
  • for queryAttributes(...) methods:

    + +
      +
    • NSDictionary
    • +
  • +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + init(_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Select clause with a list of SelectTerms

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ selectTerm: SelectTerm<D>, _ selectTerms: SelectTerm<D>...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + selectTerm + + +
    +

    a SelectTerm

    +
    +
    + + selectTerms + + +
    +

    a series of SelectTerms

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Select clause with a list of SelectTerms

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ selectTerms: [SelectTerm<D>])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + selectTerms + + +
    +

    a series of SelectTerms

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == <T, U>(lhs: Select<D, T>, rhs: Select<D, U>) -> Bool where T : SelectResultType, U : SelectResultType
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = D
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ReturnType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ReturnType = T
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + selectTerms + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let selectTerms: [SelectTerm<D>]
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Select

+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes a Select that queries for NSManagedObjectID results

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Select

+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Select that queries the value of an attribute pertained by a keyPath

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ keyPath: KeyPath<D, T>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the keyPath for the attribute

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Select

+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Select that queries the value of an attribute pertained by a keyPath

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ keyPath: KeyPath<D, ValueContainer<D>.Required<T>>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the keyPath for the attribute

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Select that queries the value of an attribute pertained by a keyPath

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<T>>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the keyPath for the attribute

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Select

+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Select that queries the value of an attribute pertained by a keyPath

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ keyPath: KeyPath<D, TransformableContainer<D>.Required<T>>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the keyPath for the attribute

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Select that queries the value of an attribute pertained by a keyPath

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ keyPath: KeyPath<D, TransformableContainer<D>.Optional<T>>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the keyPath for the attribute

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Structs/Tweak.html b/docs/Structs/Tweak.html new file mode 100644 index 0000000..7bbbdff --- /dev/null +++ b/docs/Structs/Tweak.html @@ -0,0 +1,949 @@ + + + + Tweak Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Tweak

+
+
+
public struct Tweak : FetchClause, QueryClause, DeleteClause
+ +
+
+

The Tweak clause allows fine-tuning the NSFetchRequest for a fetch or query. +Sample usage:

+
let employees = transaction.fetchAll(
+    From<MyPersonEntity>(),
+    Tweak { (fetchRequest) -> Void in
+        fetchRequest.includesPendingChanges = false
+        fetchRequest.fetchLimit = 5
+    }
+)
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + closure + +
    +
    +
    +
    +
    +
    +

    The block to customize the NSFetchRequest

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let closure: (_ fetchRequest: NSFetchRequest<NSFetchRequestResult>) -> Void
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Tweak clause with a closure where the NSFetchRequest may be configured.

    +
    +

    Important

    + Tweak‘s closure is executed only just before the fetch occurs, so make sure that any values captured by the closure is not prone to race conditions. Also, some utilities (such as ListMonitors) may keep FetchClauses in memory and may thus introduce retain cycles if reference captures are not handled properly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ closure: @escaping (_ fetchRequest: NSFetchRequest<NSFetchRequestResult>) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + closure + + +
    +

    the block to customize the NSFetchRequest

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + bridgeToObjectiveC + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var bridgeToObjectiveC: CSTweak { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Structs/VersionLock.html b/docs/Structs/VersionLock.html new file mode 100644 index 0000000..be1d779 --- /dev/null +++ b/docs/Structs/VersionLock.html @@ -0,0 +1,1093 @@ + + + + VersionLock Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

VersionLock

+
+
+
public struct VersionLock : ExpressibleByDictionaryLiteral, Equatable
+ +
+
+

The VersionLock contains the version hashes for entities. This is then passed to the CoreStoreSchema, which contains all entities for the store. An assertion will be raised if any Entity doesn’t match the version hash.

+
class Animal: CoreStoreObject {
+    let species = Value.Required<String>("species", initial: "")
+    let nickname = Value.Optional<String>("nickname")
+    let master = Relationship.ToOne<Person>("master")
+}
+class Person: CoreStoreObject {
+    let name = Value.Required<String>("name", initial: "")
+    let pet = Relationship.ToOne<Animal>("pet", inverse: { $0.master })
+}
+
+CoreStore.defaultStack = DataStack(
+    CoreStoreSchema(
+        modelVersion: "V1",
+        entities: [
+            Entity<Animal>("Animal"),
+            Entity<Person>("Person")
+        ],
+        versionLock: [
+            "Animal": [0x2698c812ebbc3b97, 0x751e3fa3f04cf9, 0x51fd460d3babc82, 0x92b4ba735b5a3053],
+            "Person": [0xae4060a59f990ef0, 0x8ac83a6e1411c130, 0xa29fea58e2e38ab6, 0x2071bb7e33d77887]
+        ]
+    )
+)
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + HashElement + +
    +
    +
    +
    +
    +
    +

    The value type for the dictionary initializer, which is UInt64

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias HashElement = UInt64
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + hashesByEntityName + +
    +
    +
    +
    +
    +
    +

    The Data hash for each entity name.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let hashesByEntityName: [EntityName : Data]
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a VersionLock with the version hash for each entity name.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ intArrayByEntityName: [EntityName : [HashElement]])
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + Key + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Key = EntityName
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + Value + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Value = [HashElement]
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(dictionaryLiteral elements: (EntityName, [HashElement])...)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: VersionLock, rhs: VersionLock) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Structs/Where.html b/docs/Structs/Where.html new file mode 100644 index 0000000..948ced1 --- /dev/null +++ b/docs/Structs/Where.html @@ -0,0 +1,2911 @@ + + + + Where Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Where

+
+
+
public struct Where<D> : WhereClauseType, FetchClause, QueryClause, DeleteClause, Hashable where D : DynamicObject
+ +
+
+

The Where clause specifies the conditions for a fetch or a query.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + &&(_:_:) + +
    +
    +
    +
    +
    +
    +

    Combines two Where predicates together using AND operator

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func && (left: Where<D>, right: Where<D>) -> Where<D>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ||(_:_:) + +
    +
    +
    +
    +
    +
    +

    Combines two Where predicates together using OR operator

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func || (left: Where<D>, right: Where<D>) -> Where<D>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + !(_:) + +
    +
    +
    +
    +
    +
    +

    Inverts the predicate of a Where clause using NOT operator

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public prefix static func ! (clause: Where<D>) -> Where<D>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + &&?(_:_:) + +
    +
    +
    +
    +
    +
    +

    Combines two Where predicates together using AND operator.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func &&? (left: Where<D>, right: Where<D>?) -> Where<D>
    + +
    +
    +
    +

    Return Value

    +

    left if right is nil, otherwise equivalent to (left && right)

    +
    +
    +
    +
  • +
  • +
    + + + + &&?(_:_:) + +
    +
    +
    +
    +
    +
    +

    Combines two Where predicates together using AND operator.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func &&? (left: Where<D>?, right: Where<D>) -> Where<D>
    + +
    +
    +
    +

    Return Value

    +

    right if left is nil, otherwise equivalent to (left && right)

    +
    +
    +
    +
  • +
  • +
    + + + + ||?(_:_:) + +
    +
    +
    +
    +
    +
    +

    Combines two Where predicates together using OR operator.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ||? (left: Where<D>, right: Where<D>?) -> Where<D>
    + +
    +
    +
    +

    Return Value

    +

    left if right is nil, otherwise equivalent to (left || right)

    +
    +
    +
    +
  • +
  • +
    + + + + ||?(_:_:) + +
    +
    +
    +
    +
    +
    +

    Combines two Where predicates together using OR operator.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ||? (left: Where<D>?, right: Where<D>) -> Where<D>
    + +
    +
    +
    +

    Return Value

    +

    right if left is nil, otherwise equivalent to (left || right)

    +
    +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause with a predicate that always evaluates to true

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause with a predicate that always evaluates to the specified boolean value

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ value: Bool)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + value + + +
    +

    the boolean value for the predicate

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause with a predicate using the specified string format and arguments

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ format: String, _ args: Any...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + format + + +
    +

    the format string for the predicate

    +
    +
    + + args + + +
    +

    the arguments for format

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a Where clause with a predicate using the specified string format and arguments

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ format: String, argumentArray: [Any]?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + format + + +
    +

    the format string for the predicate

    +
    +
    + + argumentArray + + +
    +

    the arguments for format

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality to nil

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ keyPath: KeyPathString, isEqualTo null: Void?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + null + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<U>(_ keyPath: KeyPathString, isEqualTo value: U?) where U : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + value + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<D>(_ keyPath: KeyPathString, isEqualTo object: D?) where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + object + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ keyPath: KeyPathString, isEqualTo objectID: NSManagedObjectID)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + objectID + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isMemberOf:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares membership

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<S>(_ keyPath: KeyPathString, isMemberOf list: S) where S : Sequence, S.Element : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + list + + +
    +

    the sequence to check membership of

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isMemberOf:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares membership

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<S>(_ keyPath: KeyPathString, isMemberOf list: S) where S : Sequence, S.Element : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + list + + +
    +

    the sequence to check membership of

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isMemberOf:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares membership

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<S>(_ keyPath: KeyPathString, isMemberOf list: S) where S : Sequence, S.Element : NSManagedObjectID
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + list + + +
    +

    the sequence to check membership of

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + predicate + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let predicate: NSPredicate
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ predicate: NSPredicate)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = D
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: Where, rhs: Where) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality to nil

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<V>(_ keyPath: KeyPath<D, V>, isEqualTo null: Void?) where V : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + null + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality to nil

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<O>(_ keyPath: KeyPath<D, O>, isEqualTo null: Void?) where O : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + null + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<V>(_ keyPath: KeyPath<D, V>, isEqualTo value: V?) where V : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + value + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<O>(_ keyPath: KeyPath<D, O>, isEqualTo value: O?) where O : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + value + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<O>(_ keyPath: KeyPath<D, O>, isEqualTo objectID: NSManagedObjectID) where O : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + objectID + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isMemberOf:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares membership

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<V, S>(_ keyPath: KeyPath<D, V>, isMemberOf list: S) where V : QueryableAttributeType, V == S.Element, S : Sequence
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + list + + +
    +

    the sequence to check membership of

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isMemberOf:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares membership

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<O, S>(_ keyPath: KeyPath<D, O>, isMemberOf list: S) where O : DynamicObject, O == S.Element, S : Sequence
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + list + + +
    +

    the sequence to check membership of

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isMemberOf:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares membership

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<O, S>(_ keyPath: KeyPath<D, O>, isMemberOf list: S) where O : DynamicObject, S : Sequence, S.Element : NSManagedObjectID
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + list + + +
    +

    the sequence to check membership of

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality to nil

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<V>>, isEqualTo null: Void?) where V : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + null + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality to nil

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<O>(_ keyPath: KeyPath<D, RelationshipContainer<D>.ToOne<O>>, isEqualTo null: Void?) where O : CoreStoreObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + null + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Required<V>>, isEqualTo value: V?) where V : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + value + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<V>>, isEqualTo value: V?) where V : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + value + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<O>(_ keyPath: KeyPath<D, RelationshipContainer<D>.ToOne<O>>, isEqualTo value: O?) where O : CoreStoreObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + value + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<O>(_ keyPath: KeyPath<D, RelationshipContainer<D>.ToOne<O>>, isEqualTo objectID: NSManagedObjectID) where O : CoreStoreObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + objectID + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isMemberOf:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares membership

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<V, S>(_ keyPath: KeyPath<D, ValueContainer<D>.Required<V>>, isMemberOf list: S) where V : ImportableAttributeType, V == S.Element, S : Sequence
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + list + + +
    +

    the sequence to check membership of

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isMemberOf:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares membership

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<V, S>(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<V>>, isMemberOf list: S) where V : ImportableAttributeType, V == S.Element, S : Sequence
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + list + + +
    +

    the sequence to check membership of

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isMemberOf:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares membership

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<O, S>(_ keyPath: KeyPath<D, RelationshipContainer<D>.ToOne<O>>, isMemberOf list: S) where O : CoreStoreObject, O == S.Element, S : Sequence
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + list + + +
    +

    the sequence to check membership of

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isMemberOf:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares membership

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<O, S>(_ keyPath: KeyPath<D, RelationshipContainer<D>.ToOne<O>>, isMemberOf list: S) where O : CoreStoreObject, S : Sequence, S.Element : NSManagedObjectID
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + list + + +
    +

    the sequence to check membership of

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause from a closure

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ condition: (D) -> Where<D>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + condition + + +
    +

    closure that returns the Where clause

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/Typealiases.html b/docs/Typealiases.html new file mode 100644 index 0000000..94bc934 --- /dev/null +++ b/docs/Typealiases.html @@ -0,0 +1,1006 @@ + + + + Type Aliases Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Type Aliases

+

The following type aliases are available globally.

+ +
+
+ +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    A String that pertains to the name of an *.xcdatamodeld file (without the file extension).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias XcodeDataModelFileName = String
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ModelConfiguration + +
    +
    +
    +
    +
    +
    +

    An Optional<String> that pertains to the name of a Configuration which particular groups of entities may belong to. When nil, pertains to the default configuration which includes all entities.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ModelConfiguration = String?
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ModelVersion + +
    +
    +
    +
    +
    +
    +

    An String that pertains to the name of a versioned *.xcdatamodeld file (without the file extension). Model version strings don’t necessarily have to be numeric or ordered in any way. The migration sequence will always be decided by (or the lack of) the MigrationChain.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ModelVersion = String
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + EntityName + +
    +
    +
    +
    +
    +
    +

    An String that pertains to an Entity name.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias EntityName = String
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ClassName + +
    +
    +
    +
    +
    +
    +

    An String that pertains to a dynamically-accessable class name (usable with NSClassFromString(…)).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ClassName = String
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + KeyPathString + +
    +
    +
    +
    +
    +
    +

    An String that pertains to a attribute keyPaths.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias KeyPathString = String
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/badge.svg b/docs/badge.svg new file mode 100644 index 0000000..da0aa97 --- /dev/null +++ b/docs/badge.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + documentation + + + documentation + + + 88% + + + 88% + + + diff --git a/docs/css/highlight.css b/docs/css/highlight.css new file mode 100644 index 0000000..d0db0e1 --- /dev/null +++ b/docs/css/highlight.css @@ -0,0 +1,200 @@ +/* Credit to https://gist.github.com/wataru420/2048287 */ +.highlight { + /* Comment */ + /* Error */ + /* Keyword */ + /* Operator */ + /* Comment.Multiline */ + /* Comment.Preproc */ + /* Comment.Single */ + /* Comment.Special */ + /* Generic.Deleted */ + /* Generic.Deleted.Specific */ + /* Generic.Emph */ + /* Generic.Error */ + /* Generic.Heading */ + /* Generic.Inserted */ + /* Generic.Inserted.Specific */ + /* Generic.Output */ + /* Generic.Prompt */ + /* Generic.Strong */ + /* Generic.Subheading */ + /* Generic.Traceback */ + /* Keyword.Constant */ + /* Keyword.Declaration */ + /* Keyword.Pseudo */ + /* Keyword.Reserved */ + /* Keyword.Type */ + /* Literal.Number */ + /* Literal.String */ + /* Name.Attribute */ + /* Name.Builtin */ + /* Name.Class */ + /* Name.Constant */ + /* Name.Entity */ + /* Name.Exception */ + /* Name.Function */ + /* Name.Namespace */ + /* Name.Tag */ + /* Name.Variable */ + /* Operator.Word */ + /* Text.Whitespace */ + /* Literal.Number.Float */ + /* Literal.Number.Hex */ + /* Literal.Number.Integer */ + /* Literal.Number.Oct */ + /* Literal.String.Backtick */ + /* Literal.String.Char */ + /* Literal.String.Doc */ + /* Literal.String.Double */ + /* Literal.String.Escape */ + /* Literal.String.Heredoc */ + /* Literal.String.Interpol */ + /* Literal.String.Other */ + /* Literal.String.Regex */ + /* Literal.String.Single */ + /* Literal.String.Symbol */ + /* Name.Builtin.Pseudo */ + /* Name.Variable.Class */ + /* Name.Variable.Global */ + /* Name.Variable.Instance */ + /* Literal.Number.Integer.Long */ } + .highlight .c { + color: #999988; + font-style: italic; } + .highlight .err { + color: #a61717; + background-color: #e3d2d2; } + .highlight .k { + color: #000000; + font-weight: bold; } + .highlight .o { + color: #000000; + font-weight: bold; } + .highlight .cm { + color: #999988; + font-style: italic; } + .highlight .cp { + color: #999999; + font-weight: bold; } + .highlight .c1 { + color: #999988; + font-style: italic; } + .highlight .cs { + color: #999999; + font-weight: bold; + font-style: italic; } + .highlight .gd { + color: #000000; + background-color: #ffdddd; } + .highlight .gd .x { + color: #000000; + background-color: #ffaaaa; } + .highlight .ge { + color: #000000; + font-style: italic; } + .highlight .gr { + color: #aa0000; } + .highlight .gh { + color: #999999; } + .highlight .gi { + color: #000000; + background-color: #ddffdd; } + .highlight .gi .x { + color: #000000; + background-color: #aaffaa; } + .highlight .go { + color: #888888; } + .highlight .gp { + color: #555555; } + .highlight .gs { + font-weight: bold; } + .highlight .gu { + color: #aaaaaa; } + .highlight .gt { + color: #aa0000; } + .highlight .kc { + color: #000000; + font-weight: bold; } + .highlight .kd { + color: #000000; + font-weight: bold; } + .highlight .kp { + color: #000000; + font-weight: bold; } + .highlight .kr { + color: #000000; + font-weight: bold; } + .highlight .kt { + color: #445588; } + .highlight .m { + color: #009999; } + .highlight .s { + color: #d14; } + .highlight .na { + color: #008080; } + .highlight .nb { + color: #0086B3; } + .highlight .nc { + color: #445588; + font-weight: bold; } + .highlight .no { + color: #008080; } + .highlight .ni { + color: #800080; } + .highlight .ne { + color: #990000; + font-weight: bold; } + .highlight .nf { + color: #990000; } + .highlight .nn { + color: #555555; } + .highlight .nt { + color: #000080; } + .highlight .nv { + color: #008080; } + .highlight .ow { + color: #000000; + font-weight: bold; } + .highlight .w { + color: #bbbbbb; } + .highlight .mf { + color: #009999; } + .highlight .mh { + color: #009999; } + .highlight .mi { + color: #009999; } + .highlight .mo { + color: #009999; } + .highlight .sb { + color: #d14; } + .highlight .sc { + color: #d14; } + .highlight .sd { + color: #d14; } + .highlight .s2 { + color: #d14; } + .highlight .se { + color: #d14; } + .highlight .sh { + color: #d14; } + .highlight .si { + color: #d14; } + .highlight .sx { + color: #d14; } + .highlight .sr { + color: #009926; } + .highlight .s1 { + color: #d14; } + .highlight .ss { + color: #990073; } + .highlight .bp { + color: #999999; } + .highlight .vc { + color: #008080; } + .highlight .vg { + color: #008080; } + .highlight .vi { + color: #008080; } + .highlight .il { + color: #009999; } diff --git a/docs/css/jazzy.css b/docs/css/jazzy.css new file mode 100644 index 0000000..c83db5b --- /dev/null +++ b/docs/css/jazzy.css @@ -0,0 +1,368 @@ +*, *:before, *:after { + box-sizing: inherit; } + +body { + margin: 0; + background: #fff; + color: #333; + font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; + letter-spacing: .2px; + -webkit-font-smoothing: antialiased; + box-sizing: border-box; } + +h1 { + font-size: 2rem; + font-weight: 700; + margin: 1.275em 0 0.6em; } + +h2 { + font-size: 1.75rem; + font-weight: 700; + margin: 1.275em 0 0.3em; } + +h3 { + font-size: 1.5rem; + font-weight: 700; + margin: 1em 0 0.3em; } + +h4 { + font-size: 1.25rem; + font-weight: 700; + margin: 1.275em 0 0.85em; } + +h5 { + font-size: 1rem; + font-weight: 700; + margin: 1.275em 0 0.85em; } + +h6 { + font-size: 1rem; + font-weight: 700; + margin: 1.275em 0 0.85em; + color: #777; } + +p { + margin: 0 0 1em; } + +ul, ol { + padding: 0 0 0 2em; + margin: 0 0 0.85em; } + +blockquote { + margin: 0 0 0.85em; + padding: 0 15px; + color: #858585; + border-left: 4px solid #e5e5e5; } + +img { + max-width: 100%; } + +a { + color: #4183c4; + text-decoration: none; } + a:hover, a:focus { + outline: 0; + text-decoration: underline; } + +table { + background: #fff; + width: 100%; + border-collapse: collapse; + border-spacing: 0; + overflow: auto; + margin: 0 0 0.85em; } + +tr:nth-child(2n) { + background-color: #fbfbfb; } + +th, td { + padding: 6px 13px; + border: 1px solid #ddd; } + +pre { + margin: 0 0 1.275em; + padding: .85em 1em; + overflow: auto; + background: #f7f7f7; + font-size: .85em; + font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; } + +code { + font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; } + +p > code, li > code { + background: #f7f7f7; + padding: .2em; } + p > code:before, p > code:after, li > code:before, li > code:after { + letter-spacing: -.2em; + content: "\00a0"; } + +pre code { + padding: 0; + white-space: pre; } + +.content-wrapper { + display: flex; + flex-direction: column; } + @media (min-width: 768px) { + .content-wrapper { + flex-direction: row; } } + +.header { + display: flex; + padding: 8px; + font-size: 0.875em; + background: #444; + color: #999; } + +.header-col { + margin: 0; + padding: 0 8px; } + +.header-col--primary { + flex: 1; } + +.header-link { + color: #fff; } + +.header-icon { + padding-right: 6px; + vertical-align: -4px; + height: 16px; } + +.breadcrumbs { + font-size: 0.875em; + padding: 8px 16px; + margin: 0; + background: #fbfbfb; + border-bottom: 1px solid #ddd; } + +.carat { + height: 10px; + margin: 0 5px; } + +.navigation { + order: 2; } + @media (min-width: 768px) { + .navigation { + order: 1; + width: 25%; + max-width: 300px; + padding-bottom: 64px; + overflow: hidden; + word-wrap: normal; + background: #fbfbfb; + border-right: 1px solid #ddd; } } + +.nav-groups { + list-style-type: none; + padding-left: 0; } + +.nav-group-name { + border-bottom: 1px solid #ddd; + padding: 8px 0 8px 16px; } + +.nav-group-name-link { + color: #333; } + +.nav-group-tasks { + margin: 8px 0; + padding: 0 0 0 8px; } + +.nav-group-task { + font-size: 1em; + list-style-type: none; + white-space: nowrap; } + +.nav-group-task-link { + color: #808080; } + +.main-content { + order: 1; } + @media (min-width: 768px) { + .main-content { + order: 2; + flex: 1; + padding-bottom: 60px; } } + +.section { + padding: 0 32px; + border-bottom: 1px solid #ddd; } + +.section-content { + max-width: 834px; + margin: 0 auto; + padding: 16px 0; } + +.section-name { + color: #666; + display: block; } + +.declaration .highlight { + overflow-x: initial; + padding: 8px 0; + margin: 0; + background-color: transparent; + border: none; } + +.task-group-section { + border-top: 1px solid #ddd; } + +.task-group { + padding-top: 0px; } + +.task-name-container a[name]:before { + content: ""; + display: block; } + +.item-container { + padding: 0; } + +.item { + padding-top: 8px; + width: 100%; + list-style-type: none; } + .item a[name]:before { + content: ""; + display: block; } + .item .token { + padding-left: 3px; + margin-left: 0px; + font-size: 1rem; } + .item .declaration-note { + font-size: .85em; + color: #808080; + font-style: italic; } + +.pointer-container { + border-bottom: 1px solid #ddd; + left: -23px; + padding-bottom: 13px; + position: relative; + width: 110%; } + +.pointer { + left: 21px; + top: 7px; + display: block; + position: absolute; + width: 12px; + height: 12px; + border-left: 1px solid #ddd; + border-top: 1px solid #ddd; + background: #fff; + transform: rotate(45deg); } + +.height-container { + display: none; + position: relative; + width: 100%; + overflow: hidden; } + .height-container .section { + background: #fff; + border: 1px solid #ddd; + border-top-width: 0; + padding-top: 10px; + padding-bottom: 5px; + padding: 8px 16px; } + +.aside, .language { + padding: 6px 12px; + margin: 12px 0; + border-left: 5px solid #dddddd; + overflow-y: hidden; } + .aside .aside-title, .language .aside-title { + font-size: 9px; + letter-spacing: 2px; + text-transform: uppercase; + padding-bottom: 0; + margin: 0; + color: #aaa; + -webkit-user-select: none; } + .aside p:last-child, .language p:last-child { + margin-bottom: 0; } + +.language { + border-left: 5px solid #cde9f4; } + .language .aside-title { + color: #4183c4; } + +.aside-warning { + border-left: 5px solid #ff6666; } + .aside-warning .aside-title { + color: #ff0000; } + +.graybox { + border-collapse: collapse; + width: 100%; } + .graybox p { + margin: 0; + word-break: break-word; + min-width: 50px; } + .graybox td { + border: 1px solid #ddd; + padding: 5px 25px 5px 10px; + vertical-align: middle; } + .graybox tr td:first-of-type { + text-align: right; + padding: 7px; + vertical-align: top; + word-break: normal; + width: 40px; } + +.slightly-smaller { + font-size: 0.9em; } + +.footer { + padding: 8px 16px; + background: #444; + color: #ddd; + font-size: 0.8em; } + .footer p { + margin: 8px 0; } + .footer a { + color: #fff; } + +html.dash .header, html.dash .breadcrumbs, html.dash .navigation { + display: none; } +html.dash .height-container { + display: block; } + +form[role=search] input { + font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 24px; + padding: 0 10px; + margin: 0; + border: none; + border-radius: 1em; } + .loading form[role=search] input { + background: white url(../img/spinner.gif) center right 4px no-repeat; } +form[role=search] .tt-menu { + margin: 0; + min-width: 300px; + background: #fbfbfb; + color: #333; + border: 1px solid #ddd; } +form[role=search] .tt-highlight { + font-weight: bold; } +form[role=search] .tt-suggestion { + font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; + padding: 0 8px; } + form[role=search] .tt-suggestion span { + display: table-cell; + white-space: nowrap; } + form[role=search] .tt-suggestion .doc-parent-name { + width: 100%; + text-align: right; + font-weight: normal; + font-size: 0.9em; + padding-left: 16px; } +form[role=search] .tt-suggestion:hover, +form[role=search] .tt-suggestion.tt-cursor { + cursor: pointer; + background-color: #4183c4; + color: #fff; } +form[role=search] .tt-suggestion:hover .doc-parent-name, +form[role=search] .tt-suggestion.tt-cursor .doc-parent-name { + color: #fff; } diff --git a/docs/docsets/CoreStore.docset/Contents/Info.plist b/docs/docsets/CoreStore.docset/Contents/Info.plist new file mode 100644 index 0000000..081944e --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Info.plist @@ -0,0 +1,20 @@ + + + + + CFBundleIdentifier + com.jazzy.corestore + CFBundleName + CoreStore + DocSetPlatformFamily + corestore + isDashDocset + + dashIndexFilePath + index.html + isJavaScriptEnabled + + DashDocSetFamily + dashtoc + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes.html new file mode 100644 index 0000000..a817650 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes.html @@ -0,0 +1,3126 @@ + + + + Classes Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Classes

+

The following classes are available globally.

+ +
+
+ +
+
+
+ + +
+
+ +
    +
  • +
    + + + + BaseDataTransaction + +
    +
    +
    +
    +
    +
    +

    The BaseDataTransaction is an abstract interface for NSManagedObject creates, updates, and deletes. All BaseDataTransaction subclasses manage a private NSManagedObjectContext which are direct children of the NSPersistentStoreCoordinator‘s root NSManagedObjectContext. This means that all updates are saved first to the persistent store, and then propagated up to the read-only NSManagedObjectContext.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class BaseDataTransaction
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ + +
+
+ +
    +
  • +
    + + + + CSCoreStore + +
    +
    +
    +
    +
    +
    +

    The CSCoreStore serves as the Objective-C bridging type for CoreStore.

    +
    +

    See also

    + CoreStore + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public final class CSCoreStore : NSObject
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + DataStack + +
    +
    +
    +
    +
    +
    +

    The DataStack encapsulates the data model for the Core Data stack. Each DataStack can have multiple data stores, usually specified as a Configuration in the model editor. Behind the scenes, the DataStack manages its own NSPersistentStoreCoordinator, a root NSManagedObjectContext for disk saves, and a shared NSManagedObjectContext designed as a read-only model interface for NSManagedObjects.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class DataStack : Equatable
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+
+ + + +

CSFrom

+
+
+
    +
  • +
    + + + + CSFrom + +
    +
    +
    +
    +
    +
    +

    The CSFrom serves as the Objective-C bridging type for From.

    +
    +

    See also

    + From + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public final class CSFrom : NSObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CSGroupBy + +
    +
    +
    +
    +
    +
    +

    The CSGroupBy serves as the Objective-C bridging type for GroupBy.

    +
    +

    See also

    + GroupBy + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public final class CSGroupBy : NSObject, CSQueryClause
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + InMemoryStore + +
    +
    +
    +
    +
    +
    +

    A storage interface that is backed only in memory.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class InMemoryStore : StorageInterface
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

CSInto

+
+
+
    +
  • +
    + + + + CSInto + +
    +
    +
    +
    +
    +
    +

    The CSInto serves as the Objective-C bridging type for Into<T>.

    +
    +

    See also

    + Into + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public final class CSInto : NSObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CSListMonitor + +
    +
    +
    +
    +
    +
    +

    The CSListMonitor serves as the Objective-C bridging type for ListMonitor<T>.

    +
    +

    See also

    + ListMonitor + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +@objc
    +public final class CSListMonitor : NSObject
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ + +
+
+ +
    +
  • +
    + + + + CSObjectMonitor + +
    +
    +
    +
    +
    +
    +

    The CSObjectMonitor serves as the Objective-C bridging type for ObjectMonitor<T>.

    +
    +

    See also

    + ObjectMonitor + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +@objc
    +public final class CSObjectMonitor : NSObject
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ + +
+
+ +
    +
  • +
    + + + + SQLiteStore + +
    +
    +
    +
    +
    +
    +

    A storage interface that is backed by an SQLite database.

    +
    +

    Warning

    + The default SQLite file location for the LegacySQLiteStore and SQLiteStore are different. If the app was depending on CoreStore’s default directories prior to 2.0.0, make sure to use the SQLiteStore.legacy(...) factory methods to create the SQLiteStore instead of using initializers directly. + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class SQLiteStore : LocalStorage
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CSSectionBy + +
    +
    +
    +
    +
    +
    +

    The CSSectionBy serves as the Objective-C bridging type for SectionBy.

    +
    +

    See also

    + SectionBy + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +@objc
    +public final class CSSectionBy : NSObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CSSelectTerm + +
    +
    +
    +
    +
    +
    +

    The CSSelectTerm serves as the Objective-C bridging type for SelectTerm.

    +
    +

    See also

    + SelectTerm + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public final class CSSelectTerm : NSObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CSSelect + +
    +
    +
    +
    +
    +
    +

    The CSSelect serves as the Objective-C bridging type for Select.

    +
    +

    See also

    + Select + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public final class CSSelect : NSObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CSSetupResult + +
    +
    +
    +
    +
    +
    +

    The CSSetupResult serves as the Objective-C bridging type for SetupResult.

    +
    +

    See also

    + SetupResult + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public final class CSSetupResult : NSObject
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    The SynchronousDataTransaction provides an interface for DynamicObject creates, updates, and deletes. A transaction object should typically be only used from within a transaction block initiated from DataStack.beginSynchronous(_:), or from CoreStore.beginSynchronous(_:).

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class SynchronousDataTransaction : BaseDataTransaction
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ + +
+
+ +
    +
  • +
    + + + + UnsafeDataModelSchema + +
    +
    +
    +
    +
    +
    +

    The UnsafeDataModelSchema describes models loaded directly from an existing NSManagedObjectModel. It is not advisable to continue using this model as its metadata are not available to CoreStore.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class UnsafeDataModelSchema : DynamicSchema
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + UnsafeDataTransaction + +
    +
    +
    +
    +
    +
    +

    The UnsafeDataTransaction provides an interface for non-contiguous NSManagedObject or CoreStoreObject creates, updates, and deletes. This is useful for making temporary changes, such as partially filled forms. An unsafe transaction object should typically be only used from the main queue.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class UnsafeDataTransaction : BaseDataTransaction
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ + +
+
+ +
    +
  • +
    + + + + XcodeDataModelSchema + +
    +
    +
    +
    +
    +
    +

    The XcodeDataModelSchema describes a model version declared in a single *.xcdatamodeld file.

    +
    CoreStore.defaultStack = DataStack(
    +    XcodeDataModelSchema(modelName: "MyAppV1", bundle: .main)
    +)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class XcodeDataModelSchema : DynamicSchema
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CoreStoreObject + +
    +
    +
    +
    +
    +
    +

    The CoreStoreObject is an abstract class for creating CoreStore-managed objects that are more type-safe and more convenient than NSManagedObject subclasses. The model entities for CoreStoreObject subclasses are inferred from the Swift declaration themselves; no .xcdatamodeld files are needed. To declare persisted attributes and relationships for the CoreStoreObject subclass, declare properties of type Value.Required<T>, Value.Optional<T> for values, or Relationship.ToOne<T>, Relationship.ToManyOrdered<T>, Relationship.ToManyUnordered<T> for relationships.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let nickname = Value.Optional<String>("nickname")
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +
    +class Person: CoreStoreObject {
    +    let name = Value.Required<String>("name", initial: "")
    +    let pet = Relationship.ToOne<Animal>("pet", inverse: { $0.master })
    +}
    +
    + +

    CoreStoreObject entities for a model version should be added to CoreStoreSchema instance.

    +
    CoreStore.defaultStack = DataStack(
    +    CoreStoreSchema(
    +        modelVersion: "V1",
    +        entities: [
    +            Entity<Animal>("Animal"),
    +            Entity<Person>("Person")
    +        ]
    +    )
    +)
    +
    +
    +

    See also

    + CoreStoreSchema + +
    +
    +

    See also

    + CoreStoreObject.Value + +
    +
    +

    See also

    + CoreStoreObject.Relationship + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class CoreStoreObject : DynamicObject, Hashable
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CoreStoreSchema + +
    +
    +
    +
    +
    +
    +

    The CoreStoreSchema describes models written for CoreStoreObject Swift class declarations for a particular model version. CoreStoreObject entities for a model version should be added to CoreStoreSchema instance.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let nickname = Value.Optional<String>("nickname")
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +
    +class Person: CoreStoreObject {
    +    let name = Value.Required<String>("name", initial: "")
    +    let pet = Relationship.ToOne<Animal>("pet", inverse: { $0.master })
    +}
    +
    +CoreStore.defaultStack = DataStack(
    +    CoreStoreSchema(
    +        modelVersion: "V1",
    +        entities: [
    +            Entity<Animal>("Animal"),
    +            Entity<Person>("Person")
    +        ],
    +        versionLock: [
    +            "Animal": [0x2698c812ebbc3b97, 0x751e3fa3f04cf9, 0x51fd460d3babc82, 0x92b4ba735b5a3053],
    +            "Person": [0xae4060a59f990ef0, 0x8ac83a6e1411c130, 0xa29fea58e2e38ab6, 0x2071bb7e33d77887]
    +        ]
    +    )
    +)
    +
    +
    +

    See also

    + CoreStoreObject + +
    +
    +

    See also

    + Entity + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class CoreStoreSchema : DynamicSchema
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Entity

+
+
+
    +
  • +
    + + + + Entity + +
    +
    +
    +
    +
    +
    +

    The Entity<O> contains NSEntityDescription metadata for CoreStoreObject subclasses. Pass the Entity instances to CoreStoreSchema initializer.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let nickname = Value.Optional<String>("nickname")
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +
    +class Person: CoreStoreObject {
    +    let name = Value.Required<String>("name", initial: "")
    +    let pet = Relationship.ToOne<Animal>("pet", inverse: { $0.master })
    +}
    +
    +CoreStore.defaultStack = DataStack(
    +    CoreStoreSchema(
    +        modelVersion: "V1",
    +        entities: [
    +            Entity<Animal>("Animal"),
    +            Entity<Person>("Person")
    +        ]
    +    )
    +)
    +
    +
    +

    See also

    + CoreStoreSchema + +
    +
    +

    See also

    + CoreStoreObject + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class Entity<O> : DynamicEntity where O : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ICloudStore + +
    +
    +
    +
    +
    +
    +

    A storage interface backed by an SQLite database managed by iCloud.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, message: "Please see the release notes and Core Data documentation.")
    +public final class ICloudStore : CloudStorage
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ListMonitor + +
    +
    +
    +
    +
    +
    +

    The ListMonitor monitors changes to a list of DynamicObject instances. Observers that implement the ListObserver protocol may then register themselves to the ListMonitor‘s addObserver(_:) method:

    +
    let monitor = CoreStore.monitorList(
    +    From<Person>(),
    +    Where("title", isEqualTo: "Engineer"),
    +    OrderBy(.ascending("lastName"))
    +)
    +monitor.addObserver(self)
    +
    + +

    The ListMonitor instance needs to be held on (retained) for as long as the list needs to be observed. +Observers registered via addObserver(_:) are not retained. ListMonitor only keeps a weak reference to all observers, thus keeping itself free from retain-cycles.

    + +

    Lists created with monitorList(...) keep a single-section list of objects, where each object can be accessed by index:

    +
    let firstPerson: MyPersonEntity = monitor[0]
    +
    + +

    Accessing the list with an index above the valid range will raise an exception.

    + +

    Creating a sectioned-list is also possible with the monitorSectionedList(...) method:

    +
    let monitor = CoreStore.monitorSectionedList(
    +    From<Person>(),
    +    SectionBy("age") { "Age \($0)" },
    +    Where("title", isEqualTo: "Engineer"),
    +    OrderBy(.ascending("lastName"))
    +)
    +monitor.addObserver(self)
    +
    + +

    Objects from ListMonitors created this way can be accessed either by an IndexPath or a tuple:

    +
    let indexPath = IndexPath(forItem: 3, inSection: 2)
    +let person1 = monitor[indexPath]
    +let person2 = monitor[2, 3]
    +
    + +

    In the example above, both person1 and person2 will contain the object at section=2, index=3.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public final class ListMonitor<D> : Hashable where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ObjectMonitor + +
    +
    +
    +
    +
    +
    +

    The ObjectMonitor monitors changes to a single DynamicObject instance. Observers that implement the ObjectObserver protocol may then register themselves to the ObjectMonitor‘s addObserver(_:) method:

    +
    let monitor = CoreStore.monitorObject(object)
    +monitor.addObserver(self)
    +
    + +

    The created ObjectMonitor instance needs to be held on (retained) for as long as the object needs to be observed.

    + +

    Observers registered via addObserver(_:) are not retained. ObjectMonitor only keeps a weak reference to all observers, thus keeping itself free from retain-cycles.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public final class ObjectMonitor<D> : Equatable where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + SchemaHistory + +
    +
    +
    +
    +
    +
    +

    The SchemaHistory encapsulates multiple DynamicSchema across multiple model versions. It contains all model history and is used by the DataStack to

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class SchemaHistory : ExpressibleByArrayLiteral
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    The object containing the changeset for an observed RelationshipContainer.Ordered property.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class CoreStoreObjectOrderedDiff<D> where D : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ + +
+
+ +
    +
  • +
    + + + + DynamicEntity + +
    +
    +
    +
    +
    +
    +

    Use concrete instances of Entity<O> in API that accept DynamicEntity arguments.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class DynamicEntity : Hashable
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    A SchemaMappingProvider that tries to infer model migration between two DynamicSchema versions by searching all xcmappingmodels from Bundle.allBundles or by relying on lightweight migration if possible. Throws an error if lightweight migration is impossible for the two DynamicSchema. This mapping is automatically used as a fallback mapping provider, even if no mapping providers are explicitly declared in the StorageInterface.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class InferredSchemaMappingProvider : Hashable, SchemaMappingProvider
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + UserInfo + +
    +
    +
    +
    +
    +
    +

    The UserInfo class is provided by several CoreStore types such as DataStack, ListMonitor, ObjectMonitor and transactions to allow external libraries or user apps to store their own custom data.

    +
    enum Static {
    +    static var myDataKey: Void?
    +}
    +CoreStore.defaultStack.userInfo[&Static.myDataKey] = myObject
    +
    +
    +

    Important

    + Do not use this class to store thread-sensitive data. + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class UserInfo
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    A SchemaMappingProvider that tries to infer model migration between two DynamicSchema versions by loading an xcmappingmodel file from the specified Bundle. Throws CoreStoreError.mappingModelNotFound if the xcmappingmodel file cannot be found, or if the xcmappingmodel doesn’t resolve the source and destination DynamicSchema.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class XcodeSchemaMappingProvider : Hashable, SchemaMappingProvider
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/AsynchronousDataTransaction.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/AsynchronousDataTransaction.html new file mode 100644 index 0000000..cef69ee --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/AsynchronousDataTransaction.html @@ -0,0 +1,1270 @@ + + + + AsynchronousDataTransaction Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

AsynchronousDataTransaction

+
+
+
public final class AsynchronousDataTransaction : BaseDataTransaction
+ +
+
+

The AsynchronousDataTransaction provides an interface for DynamicObject creates, updates, and deletes. A transaction object should typically be only used from within a transaction block initiated from DataStack.perform(asynchronous:...), or from CoreStore.perform(synchronous:...).

+ +
+
+ +
+
+
+
    +
  • +
    + + + + cancel() + +
    +
    +
    +
    +
    +
    +

    Cancels a transaction by throwing CoreStoreError.userCancelled.

    +
    try transaction.cancel()
    +
    +
    +

    Important

    + Never use try? or try! on a cancel() call. Always use try. Using try? will swallow the cancellation and the transaction will proceed to commit as normal. Using try! will crash the app as cancel() will always throw an error. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cancel() throws -> Never
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Result

+
+
+
    +
  • +
    + + + + Result + +
    +
    +
    +
    +
    +
    +

    The Result contains the success or failure information for a completed transaction

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum Result<T>
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + create(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a new NSManagedObject or CoreStoreObject with the specified entity type.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override func create<D>(_ into: Into<D>) -> D where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + into + + +
    +

    the Into clause indicating the destination NSManagedObject or CoreStoreObject entity type and the destination configuration

    +
    +
    +
    +
    +

    Return Value

    +

    a new NSManagedObject or CoreStoreObject instance of the specified entity type.

    +
    +
    +
    +
  • +
  • +
    + + + + edit(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an editable proxy of a specified NSManagedObject or CoreStoreObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override func edit<D>(_ object: D?) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject or CoreStoreObject to be edited

    +
    +
    +
    +
    +

    Return Value

    +

    an editable proxy for the specified NSManagedObject or CoreStoreObject.

    +
    +
    +
    +
  • +
  • +
    + + + + edit(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an editable proxy of the object with the specified NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override func edit<D>(_ into: Into<D>, _ objectID: NSManagedObjectID) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + into + + +
    +

    an Into clause specifying the entity type

    +
    +
    + + objectID + + +
    +

    the NSManagedObjectID for the object to be edited

    +
    +
    +
    +
    +

    Return Value

    +

    an editable proxy for the specified NSManagedObject or CoreStoreObject.

    +
    +
    +
    +
  • +
  • +
    + + + + delete(_:) + +
    +
    +
    +
    +
    +
    +

    Deletes a specified NSManagedObject or CoreStoreObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override func delete<D>(_ object: D?) where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject or CoreStoreObject to be deleted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + delete(_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Deletes the specified DynamicObjects.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override func delete<D>(_ object1: D?, _ object2: D?, _ objects: D?...) where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + object1 + + +
    +

    the DynamicObject to be deleted

    +
    +
    + + object2 + + +
    +

    another DynamicObject to be deleted

    +
    +
    + + objects + + +
    +

    other DynamicObjects to be deleted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + delete(_:) + +
    +
    +
    +
    +
    +
    +

    Deletes the specified DynamicObjects.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override func delete<S>(_ objects: S) where S : Sequence, S.Element : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objects + + +
    +

    the DynamicObjects to be deleted

    +
    +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/AsynchronousDataTransaction/Result.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/AsynchronousDataTransaction/Result.html new file mode 100644 index 0000000..861bb0d --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/AsynchronousDataTransaction/Result.html @@ -0,0 +1,869 @@ + + + + Result Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Result

+
+
+
public enum Result<T>
+ +
+
+

The Result contains the success or failure information for a completed transaction

+ +
+
+ +
+
+
+
    +
  • +
    + + + + success(userInfo:) + +
    +
    +
    +
    +
    +
    +

    Result<T>.success indicates that the transaction succeeded, either because the save succeeded or because there were no changes to save. The associated userInfo is the value returned from the transaction closure.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case success(userInfo: T)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + failure(error:) + +
    +
    +
    +
    +
    +
    +

    Result<T>.failure indicates that the transaction either failed or was cancelled. The associated object for this value is a CoreStoreError enum value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case failure(error: CoreStoreError)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + boolValue + +
    +
    +
    +
    +
    +
    +

    Returns true if the result indicates .success, false if the result is .failure.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var boolValue: Bool { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/BaseDataTransaction.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/BaseDataTransaction.html new file mode 100644 index 0000000..6ee9b4f --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/BaseDataTransaction.html @@ -0,0 +1,3794 @@ + + + + BaseDataTransaction Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

BaseDataTransaction

+
+
+
public class BaseDataTransaction
+ +
+
+

The BaseDataTransaction is an abstract interface for NSManagedObject creates, updates, and deletes. All BaseDataTransaction subclasses manage a private NSManagedObjectContext which are direct children of the NSPersistentStoreCoordinator‘s root NSManagedObjectContext. This means that all updates are saved first to the persistent store, and then propagated up to the read-only NSManagedObjectContext.

+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + hasChanges + +
    +
    +
    +
    +
    +
    +

    Indicates if the transaction has pending changes

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var hasChanges: Bool { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + create(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a new NSManagedObject or CoreStoreObject with the specified entity type.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func create<D>(_ into: Into<D>) -> D where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + into + + +
    +

    the Into clause indicating the destination NSManagedObject or CoreStoreObject entity type and the destination configuration

    +
    +
    +
    +
    +

    Return Value

    +

    a new NSManagedObject or CoreStoreObject instance of the specified entity type.

    +
    +
    +
    +
  • +
  • +
    + + + + edit(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an editable proxy of a specified NSManagedObject or CoreStoreObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func edit<D>(_ object: D?) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject or CoreStoreObject type to be edited

    +
    +
    +
    +
    +

    Return Value

    +

    an editable proxy for the specified NSManagedObject or CoreStoreObject.

    +
    +
    +
    +
  • +
  • +
    + + + + edit(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an editable proxy of the object with the specified NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func edit<D>(_ into: Into<D>, _ objectID: NSManagedObjectID) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + into + + +
    +

    an Into clause specifying the entity type

    +
    +
    + + objectID + + +
    +

    the NSManagedObjectID for the object to be edited

    +
    +
    +
    +
    +

    Return Value

    +

    an editable proxy for the specified NSManagedObject or CoreStoreObject.

    +
    +
    +
    +
  • +
  • +
    + + + + delete(_:) + +
    +
    +
    +
    +
    +
    +

    Deletes a specified NSManagedObject or CoreStoreObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func delete<D>(_ object: D?) where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject or CoreStoreObject to be deleted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + delete(_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Deletes the specified NSManagedObjects or CoreStoreObjects.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func delete<D>(_ object1: D?, _ object2: D?, _ objects: D?...) where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + object1 + + +
    +

    the NSManagedObject or CoreStoreObject to be deleted

    +
    +
    + + object2 + + +
    +

    another NSManagedObject or CoreStoreObject to be deleted

    +
    +
    + + objects + + +
    +

    other NSManagedObjects or CoreStoreObjects to be deleted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + delete(_:) + +
    +
    +
    +
    +
    +
    +

    Deletes the specified NSManagedObjects or CoreStoreObjects.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func delete<S>(_ objects: S) where S : Sequence, S.Element : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objects + + +
    +

    the NSManagedObjects or CoreStoreObjects to be deleted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Refreshes all registered objects NSManagedObjects in the transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func refreshAndMergeAllObjects()
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + insertedObjects(_:) + +
    +
    +
    +
    +
    +
    +

    Returns all pending DynamicObjects of the specified type that were inserted to the transaction. This method should not be called after the commit() method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func insertedObjects<D>(_ entity: D.Type) -> Set<D> where D : DynamicObject, D : Hashable
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the DynamicObject subclass to filter

    +
    +
    +
    +
    +

    Return Value

    +

    a Set of pending DynamicObjects of the specified type that were inserted to the transaction.

    +
    +
    +
    +
  • +
  • +
    + + + + insertedObjectIDs() + +
    +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjectIDs that were inserted to the transaction. This method should not be called after the commit() method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func insertedObjectIDs() -> Set<NSManagedObjectID>
    + +
    +
    +
    +

    Return Value

    +

    a Set of pending NSManagedObjectIDs that were inserted to the transaction.

    +
    +
    +
    +
  • +
  • +
    + + + + insertedObjectIDs(_:) + +
    +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjectIDs of the specified type that were inserted to the transaction. This method should not be called after the commit() method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func insertedObjectIDs<D>(_ entity: D.Type) -> Set<NSManagedObjectID> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the DynamicObject subclass to filter

    +
    +
    +
    +
    +

    Return Value

    +

    a Set of pending NSManagedObjectIDs of the specified type that were inserted to the transaction.

    +
    +
    +
    +
  • +
  • +
    + + + + updatedObjects(_:) + +
    +
    +
    +
    +
    +
    +

    Returns all pending DynamicObjects of the specified type that were updated in the transaction. This method should not be called after the commit() method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func updatedObjects<D>(_ entity: D.Type) -> Set<D> where D : DynamicObject, D : Hashable
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the DynamicObject subclass to filter

    +
    +
    +
    +
    +

    Return Value

    +

    a Set of pending DynamicObjects of the specified type that were updated in the transaction.

    +
    +
    +
    +
  • +
  • +
    + + + + updatedObjectIDs() + +
    +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjectIDs that were updated in the transaction. This method should not be called after the commit() method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func updatedObjectIDs() -> Set<NSManagedObjectID>
    + +
    +
    +
    +

    Return Value

    +

    a Set of pending NSManagedObjectIDs that were updated in the transaction.

    +
    +
    +
    +
  • +
  • +
    + + + + updatedObjectIDs(_:) + +
    +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjectIDs of the specified type that were updated in the transaction. This method should not be called after the commit() method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func updatedObjectIDs<D>(_ entity: D.Type) -> Set<NSManagedObjectID> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the DynamicObject subclass to filter

    +
    +
    +
    +
    +

    Return Value

    +

    a Set of pending NSManagedObjectIDs of the specified type that were updated in the transaction.

    +
    +
    +
    +
  • +
  • +
    + + + + deletedObjects(_:) + +
    +
    +
    +
    +
    +
    +

    Returns all pending DynamicObjects of the specified type that were deleted from the transaction. This method should not be called after the commit() method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func deletedObjects<D>(_ entity: D.Type) -> Set<D> where D : DynamicObject, D : Hashable
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the DynamicObject subclass to filter

    +
    +
    +
    +
    +

    Return Value

    +

    a Set of pending DynamicObjects of the specified type that were deleted from the transaction.

    +
    +
    +
    +
  • +
  • +
    + + + + deletedObjectIDs() + +
    +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjectIDs of the specified type that were deleted from the transaction. This method should not be called after the commit() method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func deletedObjectIDs() -> Set<NSManagedObjectID>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the DynamicObject subclass to filter

    +
    +
    +
    +
    +

    Return Value

    +

    a Set of pending NSManagedObjectIDs of the specified type that were deleted from the transaction.

    +
    +
    +
    +
  • +
  • +
    + + + + deletedObjectIDs(_:) + +
    +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjectIDs of the specified type that were deleted from the transaction. This method should not be called after the commit() method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func deletedObjectIDs<D>(_ entity: D.Type) -> Set<NSManagedObjectID> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the DynamicObject subclass to filter

    +
    +
    +
    +
    +

    Return Value

    +

    a Set of pending NSManagedObjectIDs of the specified type that were deleted from the transaction.

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + userInfo + +
    +
    +
    +
    +
    +
    +

    Allow external libraries to store custom data in the transaction. App code should rarely have a need for this.

    +
    enum Static {
    +   static var myDataKey: Void?
    +}
    +transaction.userInfo[&Static.myDataKey] = myObject
    +
    +
    +

    Important

    + Do not use this method to store thread-sensitive data. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let userInfo: UserInfo
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Creates an ImportableObject by importing from the specified import source.

    +
    +

    Throws

    + an Error thrown from any of the ImportableObject methods + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func importObject<D: ImportableObject>(
    +    _ into: Into<D>,
    +    source: D.ImportSource) throws -> D?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + into + + +
    +

    an Into clause specifying the entity type

    +
    +
    + + source + + +
    +

    the object to import values from

    +
    +
    +
    +
    +

    Return Value

    +

    the created ImportableObject instance, or nil if the import was ignored

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Updates an existing ImportableObject by importing values from the specified import source.

    +
    +

    Throws

    + an Error thrown from any of the ImportableObject methods + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func importObject<D: ImportableObject>(
    +    _ object: D,
    +    source: D.ImportSource) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + object + + +
    +

    the NSManagedObject to update

    +
    +
    + + source + + +
    +

    the object to import values from

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates multiple ImportableObjects by importing from the specified array of import sources.

    +
    +

    Throws

    + an Error thrown from any of the ImportableObject methods + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func importObjects<D: ImportableObject, S: Sequence>(
    +    _ into: Into<D>,
    +    sourceArray: S) throws -> [D] where S.Iterator.Element == D.ImportSource
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + into + + +
    +

    an Into clause specifying the entity type

    +
    +
    + + sourceArray + + +
    +

    the array of objects to import values from

    +
    +
    +
    +
    +

    Return Value

    +

    the array of created ImportableObject instances

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Updates an existing ImportableUniqueObject or creates a new instance by importing from the specified import source.

    +
    +

    Throws

    + an Error thrown from any of the ImportableUniqueObject methods + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func importUniqueObject<D: ImportableUniqueObject>(
    +    _ into: Into<D>,
    +    source: D.ImportSource) throws -> D?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + into + + +
    +

    an Into clause specifying the entity type

    +
    +
    + + source + + +
    +

    the object to import values from

    +
    +
    +
    +
    +

    Return Value

    +

    the created/updated ImportableUniqueObject instance, or nil if the import was ignored

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Updates existing ImportableUniqueObjects or creates them by importing from the specified array of import sources. +ImportableUniqueObject methods are called on the objects in the same order as they are in the sourceArray, and are returned in an array with that same order.

    +
    +

    Warning

    +

    If sourceArray contains multiple import sources with same ID, only the last ImportSource of the duplicates will be imported.

    + +
    +
    +

    Throws

    +

    an Error thrown from any of the ImportableUniqueObject methods

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func importUniqueObjects<D: ImportableUniqueObject, S: Sequence>(
    +    _ into: Into<D>,
    +    sourceArray: S,
    +    preProcess: @escaping (_ mapping: [D.UniqueIDType: D.ImportSource]) throws -> [D.UniqueIDType: D.ImportSource] = { $0 }) throws -> [D] where S.Iterator.Element == D.ImportSource
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + into + + +
    +

    an Into clause specifying the entity type

    +
    +
    + + sourceArray + + +
    +

    the array of objects to import values from

    +
    +
    + + preProcess + + +
    +

    a closure that lets the caller tweak the internal UniqueIDType-to-ImportSource mapping to be used for importing. Callers can remove from/add to/update mapping and return the updated array from the closure.

    +
    +
    +
    +
    +

    Return Value

    +

    the array of created/updated ImportableUniqueObject instances

    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the DynamicObject instance in the transaction’s context from a reference created from a transaction or from a different managed object context.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchExisting<D>(_ object: D) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    a reference to the object created/fetched outside the transaction

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject instance if the object exists in the transaction, or nil if not found.

    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the DynamicObject instance in the transaction’s context from an NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchExisting<D>(_ objectID: NSManagedObjectID) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objectID + + +
    +

    the NSManagedObjectID for the object

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject instance if the object exists in the transaction, or nil if not found.

    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the DynamicObject instances in the transaction’s context from references created from a transaction or from a different managed object context.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchExisting<D, S>(_ objects: S) -> [D] where D : DynamicObject, D == S.Element, S : Sequence
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objects + + +
    +

    an array of DynamicObjects created/fetched outside the transaction

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject array for objects that exists in the transaction

    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the DynamicObject instances in the transaction’s context from a list of NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchExisting<D, S>(_ objectIDs: S) -> [D] where D : DynamicObject, S : Sequence, S.Element == NSManagedObjectID
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objectIDs + + +
    +

    the NSManagedObjectID array for the objects

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject array for objects that exists in the transaction

    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the first DynamicObject instance that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchOne<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the first DynamicObject instance that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the first DynamicObject instance that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchOne<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the first DynamicObject instance that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the first DynamicObject instance that satisfies the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let youngestTeen = transaction.fetchOne(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchOne<B>(_ clauseChain: B) -> B.ObjectType? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the first DynamicObject instance that satisfies the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches all DynamicObject instances that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchAll<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> [D]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    all DynamicObject instances that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches all DynamicObject instances that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchAll<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> [D]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    all DynamicObject instances that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches all DynamicObject instances that satisfy the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let people = transaction.fetchAll(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchAll<B>(_ clauseChain: B) -> [B.ObjectType]? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    all DynamicObject instances that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the number of DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchCount<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> Int? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the number DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the number of DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchCount<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> Int? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the number DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the number of DynamicObjects that satisfy the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let numberOfAdults = transaction.fetchCount(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchCount<B>(_ clauseChain: B) -> Int? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the number DynamicObjects that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> NSManagedObjectID? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> NSManagedObjectID? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let youngestTeenID = transaction.fetchObjectID(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchObjectID<B>(_ clauseChain: B) -> NSManagedObjectID? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> [NSManagedObjectID]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> [NSManagedObjectID]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let idsOfAdults = transaction.fetchObjectIDs(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchObjectIDs<B>(_ clauseChain: B) -> [NSManagedObjectID]? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + queryValue(_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Queries aggregate values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queryValue<D, U>(_ from: From<D>, _ selectClause: Select<D, U>, _ queryClauses: QueryClause...) -> U? where D : DynamicObject, U : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • +
    + + + + queryValue(_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Queries aggregate values or aggregates as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queryValue<D, U>(_ from: From<D>, _ selectClause: Select<D, U>, _ queryClauses: [QueryClause]) -> U? where D : DynamicObject, U : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • +
    + + + + queryValue(_:) + +
    +
    +
    +
    +
    +
    +

    Queries a property value or aggregate as specified by the QueryChainableBuilderType built from a chain of clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    +
    let averageAdultAge = transaction.queryValue(
    +    From<MyPersonEntity>()
    +        .select(Int.self, .average(\.age))
    +        .where(\.age > 18)
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queryValue<B>(_ clauseChain: B) -> B.ResultType? where B : QueryChainableBuilderType, B.ResultType : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a QueryChainableBuilderType indicating the property/aggregate to fetch and the series of queries for the request.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query as specified by the QueryChainableBuilderType

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Queries a dictionary of attribute values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queryAttributes<D>(_ from: From<D>, _ selectClause: Select<D, NSDictionary>, _ queryClauses: QueryClause...) -> [[String : Any]]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Queries a dictionary of attribute values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queryAttributes<D>(_ from: From<D>, _ selectClause: Select<D, NSDictionary>, _ queryClauses: [QueryClause]) -> [[String : Any]]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • +
    + + + + queryAttributes(_:) + +
    +
    +
    +
    +
    +
    +

    Queries a dictionary of attribute values or as specified by the QueryChainableBuilderType built from a chain of clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    +
    let results = dataStack.queryAttributes(
    +    From<MyPersonEntity>()
    +        .select(
    +            NSDictionary.self,
    +            .attribute(\.age, as: "age"),
    +            .count(\.age, as: "numberOfPeople")
    +         )
    +        .groupBy(\.age)
    +)
    +for dictionary in results! {
    +    let age = dictionary["age"] as! Int
    +    let count = dictionary["numberOfPeople"] as! Int
    +    print("There are \(count) people who are \(age) years old."
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queryAttributes<B>(_ clauseChain: B) -> [[String : Any]]? where B : QueryChainableBuilderType, B.ResultType == NSDictionary
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a QueryChainableBuilderType indicating the properties to fetch and the series of queries for the request.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query as specified by the QueryChainableBuilderType

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + unsafeContext() + +
    +
    +
    +
    +
    +
    +

    The internal NSManagedObjectContext managed by this instance. Using this context directly should typically be avoided, and is provided by CoreStore only for extremely specialized cases.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func unsafeContext() -> NSManagedObjectContext
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSAsynchronousDataTransaction.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSAsynchronousDataTransaction.html new file mode 100644 index 0000000..871b525 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSAsynchronousDataTransaction.html @@ -0,0 +1,1212 @@ + + + + CSAsynchronousDataTransaction Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSAsynchronousDataTransaction

+
+
+
@objc
+public final class CSAsynchronousDataTransaction : CSBaseDataTransaction, CoreStoreObjectiveCType
+ +
+
+

The CSAsynchronousDataTransaction serves as the Objective-C bridging type for AsynchronousDataTransaction.

+
+

See also

+ AsynchronousDataTransaction + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Saves the transaction changes. This method should not be used after the -commitWithCompletion: method was already called once.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func commitWithSuccess(_ success: (() -> Void)?, failure: ((CSError) -> Void)?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + success + + +
    +

    the block executed if the save succeeds.

    +
    +
    + + failure + + +
    +

    the block executed if the save fails. A CSError is reported as the argument of the block.

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + createInto(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a new NSManagedObject with the specified entity type.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public override func createInto(_ into: CSInto) -> Any
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + into + + +
    +

    the CSInto clause indicating the destination NSManagedObject entity type and the destination configuration

    +
    +
    +
    +
    +

    Return Value

    +

    a new NSManagedObject instance of the specified entity type.

    +
    +
    +
    +
  • +
  • +
    + + + + editObject(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an editable proxy of a specified NSManagedObject. This method should not be used after the -commitWithCompletion: method was already called once.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public override func editObject(_ object: NSManagedObject?) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject type to be edited

    +
    +
    +
    +
    +

    Return Value

    +

    an editable proxy for the specified NSManagedObject.

    +
    +
    +
    +
  • +
  • +
    + + + + editInto(_:objectID:) + +
    +
    +
    +
    +
    +
    +

    Returns an editable proxy of the object with the specified NSManagedObjectID. This method should not be used after the -commitWithCompletion: method was already called once.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public override func editInto(_ into: CSInto, objectID: NSManagedObjectID) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + into + + +
    +

    a CSInto clause specifying the entity type

    +
    +
    + + objectID + + +
    +

    the NSManagedObjectID for the object to be edited

    +
    +
    +
    +
    +

    Return Value

    +

    an editable proxy for the specified NSManagedObject.

    +
    +
    +
    +
  • +
  • +
    + + + + deleteObject(_:) + +
    +
    +
    +
    +
    +
    +

    Deletes a specified NSManagedObject. This method should not be used after the -commitWithCompletion: method was already called once.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public override func deleteObject(_ object: NSManagedObject?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject type to be deleted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + deleteObjects(_:) + +
    +
    +
    +
    +
    +
    +

    Deletes the specified NSManagedObjects.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public override func deleteObjects(_ objects: [NSManagedObject])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objects + + +
    +

    the NSManagedObjects type to be deleted

    +
    +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSBaseDataTransaction.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSBaseDataTransaction.html new file mode 100644 index 0000000..7bec729 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSBaseDataTransaction.html @@ -0,0 +1,2150 @@ + + + + CSBaseDataTransaction Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSBaseDataTransaction

+
+
+
@objc
+public class CSBaseDataTransaction : NSObject
+ +
+
+

The CSBaseDataTransaction serves as the Objective-C bridging type for BaseDataTransaction.

+
+

See also

+ BaseDataTransaction + +
+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + hasChanges + +
    +
    +
    +
    +
    +
    +

    Indicates if the transaction has pending changes

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var hasChanges: Bool { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + createInto(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a new NSManagedObject with the specified entity type.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func createInto(_ into: CSInto) -> Any
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + into + + +
    +

    the CSInto clause indicating the destination NSManagedObject entity type and the destination configuration

    +
    +
    +
    +
    +

    Return Value

    +

    a new NSManagedObject instance of the specified entity type.

    +
    +
    +
    +
  • +
  • +
    + + + + editObject(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an editable proxy of a specified NSManagedObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func editObject(_ object: NSManagedObject?) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject type to be edited

    +
    +
    +
    +
    +

    Return Value

    +

    an editable proxy for the specified NSManagedObject.

    +
    +
    +
    +
  • +
  • +
    + + + + editInto(_:objectID:) + +
    +
    +
    +
    +
    +
    +

    Returns an editable proxy of the object with the specified NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func editInto(_ into: CSInto, objectID: NSManagedObjectID) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + into + + +
    +

    a CSInto clause specifying the entity type

    +
    +
    + + objectID + + +
    +

    the NSManagedObjectID for the object to be edited

    +
    +
    +
    +
    +

    Return Value

    +

    an editable proxy for the specified NSManagedObject.

    +
    +
    +
    +
  • +
  • +
    + + + + deleteObject(_:) + +
    +
    +
    +
    +
    +
    +

    Deletes a specified NSManagedObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func deleteObject(_ object: NSManagedObject?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject to be deleted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + deleteObjects(_:) + +
    +
    +
    +
    +
    +
    +

    Deletes the specified NSManagedObjects.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func deleteObjects(_ objects: [NSManagedObject])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objects + + +
    +

    the NSManagedObjects to be deleted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Refreshes all registered objects NSManagedObjects in the transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func refreshAndMergeAllObjects()
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjects of the specified type that were inserted to the transaction. This method should not be called after the -commit*: method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func insertedObjectsOfType(_ entity: NSManagedObject.Type) -> Set<NSManagedObject>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the NSManagedObject subclass to filter

    +
    +
    +
    +
    +

    Return Value

    +

    an NSSet of pending NSManagedObjects of the specified type that were inserted to the transaction.

    +
    +
    +
    +
  • +
  • +
    + + + + insertedObjectIDs() + +
    +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjectIDs that were inserted to the transaction. This method should not be called after the -commit*: method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func insertedObjectIDs() -> Set<NSManagedObjectID>
    + +
    +
    +
    +

    Return Value

    +

    an NSSet of pending NSManagedObjectIDs that were inserted to the transaction.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjectIDs of the specified type that were inserted to the transaction. This method should not be called after the -commit*: method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func insertedObjectIDsOfType(_ entity: NSManagedObject.Type) -> Set<NSManagedObjectID>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the NSManagedObject subclass to filter

    +
    +
    +
    +
    +

    Return Value

    +

    an NSSet of pending NSManagedObjectIDs of the specified type that were inserted to the transaction.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjects of the specified type that were updated in the transaction. This method should not be called after the -commit*: method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func updatedObjectsOfType(_ entity: NSManagedObject.Type) -> Set<NSManagedObject>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the NSManagedObject subclass to filter

    +
    +
    +
    +
    +

    Return Value

    +

    an NSSet of pending NSManagedObjects of the specified type that were updated in the transaction.

    +
    +
    +
    +
  • +
  • +
    + + + + updatedObjectIDs() + +
    +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjectIDs that were updated in the transaction. This method should not be called after the -commit*: method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func updatedObjectIDs() -> Set<NSManagedObjectID>
    + +
    +
    +
    +

    Return Value

    +

    an NSSet of pending NSManagedObjectIDs that were updated in the transaction.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjectIDs of the specified type that were updated in the transaction. This method should not be called after the -commit*: method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func updatedObjectIDsOfType(_ entity: NSManagedObject.Type) -> Set<NSManagedObjectID>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the NSManagedObject subclass to filter

    +
    +
    +
    +
    +

    Return Value

    +

    an NSSet of pending NSManagedObjectIDs of the specified type that were updated in the transaction.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjects of the specified type that were deleted from the transaction. This method should not be called after the -commit*: method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func deletedObjectsOfType(_ entity: NSManagedObject.Type) -> Set<NSManagedObject>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the NSManagedObject subclass to filter

    +
    +
    +
    +
    +

    Return Value

    +

    an NSSet of pending NSManagedObjects of the specified type that were deleted from the transaction.

    +
    +
    +
    +
  • +
  • +
    + + + + deletedObjectIDs() + +
    +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjectIDs of the specified type that were deleted from the transaction. This method should not be called after the -commit*: method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func deletedObjectIDs() -> Set<NSManagedObjectID>
    + +
    +
    +
    +

    Return Value

    +

    an NSSet of pending NSManagedObjectIDs of the specified type that were deleted from the transaction.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns all pending NSManagedObjectIDs of the specified type that were deleted from the transaction. This method should not be called after the -commit*: method was called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func deletedObjectIDsOfType(_ entity: NSManagedObject.Type) -> Set<NSManagedObjectID>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the NSManagedObject subclass to filter

    +
    +
    +
    +
    +

    Return Value

    +

    a Set of pending NSManagedObjectIDs of the specified type that were deleted from the transaction.

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Fetches the NSManagedObject instance in the transaction’s context from a reference created from a transaction or from a different managed object context.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchExistingObject(_ object: NSManagedObject) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    a reference to the object created/fetched outside the transaction

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject instance if the object exists in the transaction, or nil if not found.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches the NSManagedObject instance in the transaction’s context from an NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchExistingObjectWithID(_ objectID: NSManagedObjectID) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objectID + + +
    +

    the NSManagedObjectID for the object

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject instance if the object exists in the transaction, or nil if not found.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches the NSManagedObject instances in the transaction’s context from references created from a transaction or from a different managed object context.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchExistingObjects(_ objects: [NSManagedObject]) -> [Any]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objects + + +
    +

    an array of NSManagedObjects created/fetched outside the transaction

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject array for objects that exists in the transaction

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches the NSManagedObject instances in the transaction’s context from a list of NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchExistingObjectsWithIDs(_ objectIDs: [NSManagedObjectID]) -> [Any]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objectIDs + + +
    +

    the NSManagedObjectID array for the objects

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject array for objects that exists in the transaction

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches the first NSManagedObject instance that satisfies the specified CSFetchClauses. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchOneFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for the fetch request. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the first NSManagedObject instance that satisfies the specified CSFetchClauses

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches all NSManagedObject instances that satisfy the specified CSFetchClauses. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchAllFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> [Any]?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for the fetch request. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    all NSManagedObject instances that satisfy the specified CSFetchClauses

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches the number of NSManagedObjects that satisfy the specified CSFetchClauses. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchCountFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> NSNumber?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for the fetch request. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the number NSManagedObjects that satisfy the specified CSFetchClauses

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for the first NSManagedObject that satisfies the specified CSFetchClauses. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchObjectIDFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> NSManagedObjectID?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for the fetch request. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first NSManagedObject that satisfies the specified CSFetchClauses

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Queries aggregate values as specified by the CSQueryClauses. Requires at least a CSSelect clause, and optional CSWhere, CSOrderBy, CSGroupBy, and CSTweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func queryValueFrom(_ from: CSFrom, selectClause: CSSelect, queryClauses: [CSQueryClause]) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a CSSelect clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of CSQueryClause instances for the query request. Accepts CSWhere, CSOrderBy, CSGroupBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the CSSelect parameter.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Queries a dictionary of attribute values as specified by the CSQueryClauses. Requires at least a CSSelect clause, and optional CSWhere, CSOrderBy, CSGroupBy, and CSTweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func queryAttributesFrom(_ from: CSFrom, selectClause: CSSelect, queryClauses: [CSQueryClause]) -> [[String : Any]]?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a CSSelect clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of CSQueryClause instances for the query request. Accepts CSWhere, CSOrderBy, CSGroupBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the CSSelect parameter.

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSCoreStore.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSCoreStore.html new file mode 100644 index 0000000..89fd739 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSCoreStore.html @@ -0,0 +1,2721 @@ + + + + CSCoreStore Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSCoreStore

+
+
+
@objc
+public final class CSCoreStore : NSObject
+ +
+
+

The CSCoreStore serves as the Objective-C bridging type for CoreStore.

+
+

See also

+ CoreStore + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + defaultStack + +
    +
    +
    +
    +
    +
    +

    The default CSDataStack instance to be used. If defaultStack is not set before the first time accessed, a default-configured CSDataStack will be created.

    +
    +

    See also

    + CSDataStack + +
    +
    +

    Note

    + Changing the defaultStack is thread safe, but it is recommended to setup CSDataStacks on a common queue (e.g. the main queue). + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static var defaultStack: CSDataStack { get set }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Asynchronously adds a CSInMemoryStore to the defaultStack. Migrations are also initiated by default.

    +
    NSError *error;
    +NSProgress *migrationProgress = [dataStack
    +    addInMemoryStorage:[CSInMemoryStore new]
    +    completion:^(CSSetupResult *result) {
    +        if (result.isSuccess) {
    +            // ...
    +        }
    +    }
    +    error: &error];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func addInMemoryStorage(_ storage: CSInMemoryStore, completion: @escaping (CSSetupResult) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the CSInMemoryStore instance

    +
    +
    + + completion + + +
    +

    the closure to be executed on the main queue when the process completes, either due to success or failure. The closure’s CSSetupResult argument indicates the result. This closure is NOT executed if an error is thrown, but will be executed with a failure CSSetupResult result if an error occurs asynchronously.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously adds a CSSQLiteStore to the defaultStack. Migrations are also initiated by default.

    +
    NSError *error;
    +NSProgress *migrationProgress = [dataStack
    +    addInMemoryStorage:[[CSSQLiteStore alloc]
    +    initWithFileName:@"core_data.sqlite"
    +    configuration:@"Config1"]
    +    completion:^(CSSetupResult *result) {
    +        if (result.isSuccess) {
    +            // ...
    +        }
    +    }
    +    error: &error];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func addSQLiteStorage(_ storage: CSSQLiteStore, completion: @escaping (CSSetupResult) -> Void, error: NSErrorPointer) -> Progress?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + storage + + +
    +

    the CSSQLiteStore instance

    +
    +
    + + completion + + +
    +

    the closure to be executed on the main queue when the process completes, either due to success or failure. The closure’s CSSetupResult argument indicates the result. This closure is NOT executed if an error is thrown, but will be executed with a failure CSSetupResult result if an error occurs asynchronously. Note that the CSLocalStorage associated to the -[CSSetupResult storage] may not always be the same instance as the parameter argument if a previous CSLocalStorage was already added at the same URL and with the same configuration.

    +
    +
    + + error + + +
    +

    the NSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    an NSProgress instance if a migration has started. nil if no migrations are required or if error was set.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Migrates a CSSQLiteStore to match the defaultStack‘s managed object model version. This method does NOT add the migrated store to the data stack.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func upgradeStorageIfNeeded(_ storage: CSSQLiteStore, completion: @escaping (CSMigrationResult) -> Void, error: NSErrorPointer) -> Progress?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + storage + + +
    +

    the CSSQLiteStore instance

    +
    +
    + + completion + + +
    +

    the closure to be executed on the main queue when the migration completes, either due to success or failure. The closure’s CSMigrationResult argument indicates the result. This closure is NOT executed if an error is thrown, but will be executed with a failure CSSetupResult result if an error occurs asynchronously.

    +
    +
    + + error + + +
    +

    the NSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    an NSProgress instance if a migration has started. nil if no migrations are required or if error was set.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Checks the migration steps required for the CSSQLiteStore to match the defaultStack‘s managed object model version.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func requiredMigrationsForSQLiteStore(_ storage: CSSQLiteStore, error: NSErrorPointer) -> [CSMigrationType]?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the CSSQLiteStore instance

    +
    +
    + + error + + +
    +

    the NSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    a CSMigrationType array indicating the migration steps required for the store, or an empty array if the file does not exist yet. Otherwise, nil is returned and the error argument is set if either inspection of the store failed, or if no mapping model was found/inferred.

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + monitorObject(_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, creates an CSObjectMonitor for the specified NSManagedObject. Multiple CSObjectObservers may then register themselves to be notified when changes are made to the NSManagedObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func monitorObject(_ object: NSManagedObject) -> CSObjectMonitor
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject to observe changes from

    +
    +
    +
    +
    +

    Return Value

    +

    a CSObjectMonitor that monitors changes to object

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, creates a CSListMonitor for a list of NSManagedObjects that satisfy the specified fetch clauses. Multiple CSListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func monitorListFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> CSListMonitor
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for fetching the object list. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a CSListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, asynchronously creates a CSListMonitor for a list of NSManagedObjects that satisfy the specified fetch clauses. Multiple CSListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func monitorListByCreatingAsynchronously(_ createAsynchronously: @escaping (CSListMonitor) -> Void, from: CSFrom, fetchClauses: [CSFetchClause])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created CSListMonitor instance

    +
    +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for fetching the object list. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, creates a CSListMonitor for a sectioned list of NSManagedObjects that satisfy the specified fetch clauses. Multiple CSListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func monitorSectionedListFrom(_ from: CSFrom, sectionBy: CSSectionBy, fetchClauses: [CSFetchClause]) -> CSListMonitor
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a CSSectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for fetching the object list. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a CSListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, asynchronously creates a CSListMonitor for a sectioned list of NSManagedObjects that satisfy the specified fetch clauses. Multiple CSListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func monitorSectionedListByCreatingAsynchronously(_ createAsynchronously: @escaping (CSListMonitor) -> Void, from: CSFrom, sectionBy: CSSectionBy, fetchClauses: [CSFetchClause])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created CSListMonitor instance

    +
    +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a CSSectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for fetching the object list. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the NSManagedObject instance in the transaction’s context from a reference created from a transaction or from a different managed object context.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func fetchExistingObject(_ object: NSManagedObject) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    a reference to the object created/fetched outside the transaction

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject instance if the object exists in the transaction, or nil if not found.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the NSManagedObject instance in the transaction’s context from an NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func fetchExistingObjectWithID(_ objectID: NSManagedObjectID) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objectID + + +
    +

    the NSManagedObjectID for the object

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject instance if the object exists in the transaction, or nil if not found.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the NSManagedObject instances in the transaction’s context from references created from a transaction or from a different managed object context.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func fetchExistingObjects(_ objects: [NSManagedObject]) -> [Any]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objects + + +
    +

    an array of NSManagedObjects created/fetched outside the transaction

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject array for objects that exists in the transaction

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the NSManagedObject instances in the transaction’s context from a list of NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func fetchExistingObjectsWithIDs(_ objectIDs: [NSManagedObjectID]) -> [Any]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objectIDs + + +
    +

    the NSManagedObjectID array for the objects

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject array for objects that exists in the transaction

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the first NSManagedObject instance that satisfies the specified CSFetchClauses. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func fetchOneFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for the fetch request. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the first NSManagedObject instance that satisfies the specified CSFetchClauses

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches all NSManagedObject instances that satisfy the specified CSFetchClauses. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func fetchAllFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> [Any]?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for the fetch request. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    all NSManagedObject instances that satisfy the specified CSFetchClauses

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the number of NSManagedObjects that satisfy the specified CSFetchClauses. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func fetchCountFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> NSNumber?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for the fetch request. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the number NSManagedObjects that satisfy the specified CSFetchClauses

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the NSManagedObjectID for the first NSManagedObject that satisfies the specified CSFetchClauses. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func fetchObjectIDFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> NSManagedObjectID?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for the fetch request. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first NSManagedObject that satisfies the specified CSFetchClauses

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the NSManagedObjectID for all NSManagedObjects that satisfy the specified CSFetchClauses. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func fetchObjectIDsFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> [NSManagedObjectID]?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for all NSManagedObjects that satisfy the specified CSFetchClauses

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, queries aggregate values as specified by the CSQueryClauses. Requires at least a CSSelect clause, and optional CSWhere, CSOrderBy, CSGroupBy, and CSTweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func queryValueFrom(_ from: CSFrom, selectClause: CSSelect, queryClauses: [CSQueryClause]) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a CSSelect clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of CSQueryClause instances for the query request. Accepts CSWhere, CSOrderBy, CSGroupBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the CSSelect parameter.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, queries a dictionary of attribute values as specified by the CSQueryClauses. Requires at least a CSSelect clause, and optional CSWhere, CSOrderBy, CSGroupBy, and CSTweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func queryAttributesFrom(_ from: CSFrom, selectClause: CSSelect, queryClauses: [CSQueryClause]) -> [[String : Any]]?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a CSSelect clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of CSQueryClause instances for the query request. Accepts CSWhere, CSOrderBy, CSGroupBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the CSSelect parameter.

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + modelVersion + +
    +
    +
    +
    +
    +
    +

    Returns the defaultStack‘s model version. The version string is the same as the name of the version-specific .xcdatamodeld file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static var modelVersion: String { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the entity name-to-class type mapping from the defaultStack‘s model.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func entityTypesByNameForType(_ type: NSManagedObject.Type) -> [EntityName : NSManagedObject.Type]
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the NSEntityDescription for the specified NSManagedObject subclass from defaultStack‘s model.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func entityDescriptionForClass(_ type: NSManagedObject.Type) -> NSEntityDescription?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates an CSInMemoryStore with default parameters and adds it to the defaultStack. This method blocks until completion.

    +
    CSSQLiteStore *storage = [CSCoreStore addInMemoryStorageAndWaitAndReturnError:&error];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +@objc
    +public static func addInMemoryStorageAndWaitAndReturnError(_ error: NSErrorPointer) -> CSInMemoryStore?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + error + + +
    +

    the NSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    the CSInMemoryStore added to the defaultStack

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates an CSSQLiteStore with default parameters and adds it to the defaultStack. This method blocks until completion.

    +
    CSSQLiteStore *storage = [CSCoreStore addSQLiteStorageAndWaitAndReturnError:&error];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +@objc
    +public static func addSQLiteStorageAndWaitAndReturnError(_ error: NSErrorPointer) -> CSSQLiteStore?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + error + + +
    +

    the NSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    the CSSQLiteStore added to the defaultStack

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Adds a CSInMemoryStore to the defaultStack and blocks until completion.

    +
    NSError *error;
    +CSInMemoryStore *storage = [CSCoreStore
    +    addStorageAndWait: [[CSInMemoryStore alloc] initWithConfiguration: @"Config1"]
    +    error: &error];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +@objc
    +public static func addInMemoryStorageAndWait(_ storage: CSInMemoryStore, error: NSErrorPointer) -> CSInMemoryStore?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the CSInMemoryStore

    +
    +
    + + error + + +
    +

    the NSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    the CSInMemoryStore added to the defaultStack

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Adds a CSSQLiteStore to the defaultStack and blocks until completion.

    +
    NSError *error;
    +CSSQLiteStore *storage = [CSCoreStore
    +    addStorageAndWait: [[CSSQLiteStore alloc] initWithConfiguration: @"Config1"]
    +    error: &error];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +@objc
    +public static func addSQLiteStorageAndWait(_ storage: CSSQLiteStore, error: NSErrorPointer) -> CSSQLiteStore?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the CSSQLiteStore

    +
    +
    + + error + + +
    +

    the NSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    the CSSQLiteStore added to the defaultStack

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + beginAsynchronous(_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, begins a transaction asynchronously where NSManagedObject creates, updates, and deletes can be made.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func beginAsynchronous(_ closure: @escaping (_ transaction: CSAsynchronousDataTransaction) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + closure + + +
    +

    the block where creates, updates, and deletes can be made to the transaction. Transaction blocks are executed serially in a background queue, and all changes are made from a concurrent NSManagedObjectContext.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, begins a transaction synchronously where NSManagedObject creates, updates, and deletes can be made.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func beginSynchronous(_ closure: @escaping (_ transaction: CSSynchronousDataTransaction) -> Void, error: NSErrorPointer) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + closure + + +
    +

    the block where creates, updates, and deletes can be made to the transaction. Transaction blocks are executed serially in a background queue, and all changes are made from a concurrent NSManagedObjectContext.

    +
    +
    +
    +
    +

    Return Value

    +

    a CSSaveResult value indicating success or failure, or nil if the transaction was not comitted synchronously

    +
    +
    +
    +
  • +
  • +
    + + + + beginUnsafe() + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, begins a child transaction where NSManagedObject creates, updates, and deletes can be made. This is useful for making temporary changes, such as partially filled forms.

    + +

    To support undo methods such as -undo, -redo, and -rollback, use the -beginSafeWithSupportsUndo: method passing YES to the argument. Without undo support, calling those methods will raise an exception.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func beginUnsafe() -> CSUnsafeDataTransaction
    + +
    +
    +
    +

    Return Value

    +

    a CSUnsafeDataTransaction instance where creates, updates, and deletes can be made.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, begins a child transaction where NSManagedObject creates, updates, and deletes can be made. This is useful for making temporary changes, such as partially filled forms.

    + +
      +
    • prameter supportsUndo: -undo, -redo, and -rollback methods are only available when this parameter is YES, otherwise those method will raise an exception. Note that turning on Undo support may heavily impact performance especially on iOS or watchOS where memory is limited.
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func beginUnsafeWithSupportsUndo(_ supportsUndo: Bool) -> CSUnsafeDataTransaction
    + +
    +
    +
    +

    Return Value

    +

    a CSUnsafeDataTransaction instance where creates, updates, and deletes can be made.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Refreshes all registered objects NSManagedObjects in the defaultStack.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func refreshAndMergeAllObjects()
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSDataStack.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSDataStack.html new file mode 100644 index 0000000..4e4a80f --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSDataStack.html @@ -0,0 +1,2847 @@ + + + + CSDataStack Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSDataStack

+
+
+
@objc
+public final class CSDataStack : NSObject, CoreStoreObjectiveCType
+ +
+
+

The CSDataStack serves as the Objective-C bridging type for DataStack.

+
+

See also

+ DataStack + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes a CSDataStack with default settings. CoreStore searches for .xcdatamodeld from the main NSBundle and loads an NSManagedObjectModel from it. An assertion is raised if the model could not be found.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience override init()
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a CSDataStack from the model with the specified modelName in the specified bundle.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(xcodeModelName: XcodeDataModelFileName?, bundle: Bundle?, versionChain: [String]?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + xcodeModelName + + +
    +

    the name of the (.xcdatamodeld) model file. If not specified, the application name (CFBundleName) will be used if it exists, or CoreData if it the bundle name was not set.

    +
    +
    + + bundle + + +
    +

    an optional bundle to load models from. If not specified, the main bundle will be used.

    +
    +
    + + versionChain + + +
    +

    the version strings that indicate the sequence of model versions to be used as the order for progressive migrations. If not specified, will default to a non-migrating data stack.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + modelVersion + +
    +
    +
    +
    +
    +
    +

    Returns the stack’s model version. The version string is the same as the name of the version-specific .xcdatamodeld file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var modelVersion: String { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the entity name-to-class type mapping from the CSDataStack‘s model.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func entityTypesByNameForType(_ type: NSManagedObject.Type) -> [EntityName : NSManagedObject.Type]
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the NSEntityDescription for the specified NSManagedObject subclass from stack’s model.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func entityDescriptionForClass(_ type: NSManagedObject.Type) -> NSEntityDescription?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates an CSInMemoryStore with default parameters and adds it to the stack. This method blocks until completion.

    +
    CSSQLiteStore *storage = [dataStack addInMemoryStorageAndWaitAndReturnError:&error];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +@objc
    +public func addInMemoryStorageAndWaitAndReturnError(_ error: NSErrorPointer) -> CSInMemoryStore?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + error + + +
    +

    the NSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    the CSInMemoryStore added to the stack

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates an CSSQLiteStore with default parameters and adds it to the stack. This method blocks until completion.

    +
    CSSQLiteStore *storage = [dataStack addSQLiteStorageAndWaitAndReturnError:&error];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +@objc
    +public func addSQLiteStorageAndWaitAndReturnError(_ error: NSErrorPointer) -> CSSQLiteStore?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + error + + +
    +

    the NSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    the CSSQLiteStore added to the stack

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Adds a CSInMemoryStore to the stack and blocks until completion.

    +
    NSError *error;
    +CSInMemoryStore *storage = [dataStack
    +    addStorageAndWait: [[CSInMemoryStore alloc] initWithConfiguration: @"Config1"]
    +    error: &error];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +@objc
    +public func addInMemoryStorageAndWait(_ storage: CSInMemoryStore, error: NSErrorPointer) -> CSInMemoryStore?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the CSInMemoryStore

    +
    +
    + + error + + +
    +

    the NSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    the CSInMemoryStore added to the stack

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Adds a CSSQLiteStore to the stack and blocks until completion.

    +
    NSError *error;
    +CSSQLiteStore *storage = [dataStack
    +    addStorageAndWait: [[CSSQLiteStore alloc] initWithConfiguration: @"Config1"]
    +    error: &error];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +@objc
    +public func addSQLiteStorageAndWait(_ storage: CSSQLiteStore, error: NSErrorPointer) -> CSSQLiteStore?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the CSSQLiteStore

    +
    +
    + + error + + +
    +

    the NSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    the CSSQLiteStore added to the stack

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + bridgeToSwift + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let bridgeToSwift: DataStack
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ swiftValue: DataStack)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Asynchronously adds a CSInMemoryStore to the stack. Migrations are also initiated by default.

    +
    NSError *error;
    +NSProgress *migrationProgress = [dataStack 
    +    addInMemoryStorage:[CSInMemoryStore new]
    +    completion:^(CSSetupResult *result) {
    +        if (result.isSuccess) {
    +            // ...
    +        }
    +    }
    +    error: &error];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func addInMemoryStorage(_ storage: CSInMemoryStore, completion: @escaping (CSSetupResult) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the CSInMemoryStore instance

    +
    +
    + + completion + + +
    +

    the closure to be executed on the main queue when the process completes, either due to success or failure. The closure’s CSSetupResult argument indicates the result. This closure is NOT executed if an error is thrown, but will be executed with a failure CSSetupResult result if an error occurs asynchronously.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously adds a CSSQLiteStore to the stack. Migrations are also initiated by default.

    +
    NSError *error;
    +NSProgress *migrationProgress = [dataStack
    +    addInMemoryStorage:[[CSSQLiteStore alloc] 
    +        initWithFileName:@"core_data.sqlite"
    +        configuration:@"Config1"]
    +    completion:^(CSSetupResult *result) {
    +        if (result.isSuccess) {
    +            // ...
    +        }
    +    }
    +    error: &error];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func addSQLiteStorage(_ storage: CSSQLiteStore, completion: @escaping (CSSetupResult) -> Void, error: NSErrorPointer) -> Progress?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + storage + + +
    +

    the CSSQLiteStore instance

    +
    +
    + + completion + + +
    +

    the closure to be executed on the main queue when the process completes, either due to success or failure. The closure’s CSSetupResult argument indicates the result. This closure is NOT executed if an error is thrown, but will be executed with a failure CSSetupResult result if an error occurs asynchronously. Note that the CSLocalStorage associated to the -[CSSetupResult storage] may not always be the same instance as the parameter argument if a previous CSLocalStorage was already added at the same URL and with the same configuration.

    +
    +
    + + error + + +
    +

    the NSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    an NSProgress instance if a migration has started. nil if no migrations are required or if error was set.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Migrates a CSSQLiteStore to match the CSDataStack‘s managed object model version. This method does NOT add the migrated store to the data stack.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func upgradeStorageIfNeeded(_ storage: CSSQLiteStore, completion: @escaping (CSMigrationResult) -> Void, error: NSErrorPointer) -> Progress?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + storage + + +
    +

    the CSSQLiteStore instance

    +
    +
    + + completion + + +
    +

    the closure to be executed on the main queue when the migration completes, either due to success or failure. The closure’s CSMigrationResult argument indicates the result. This closure is NOT executed if an error is thrown, but will be executed with a failure CSSetupResult result if an error occurs asynchronously.

    +
    +
    + + error + + +
    +

    the NSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    an NSProgress instance if a migration has started. nil if no migrations are required or if error was set.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Checks the migration steps required for the CSSQLiteStore to match the CSDataStack‘s managed object model version.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func requiredMigrationsForSQLiteStore(_ storage: CSSQLiteStore, error: NSErrorPointer) -> [CSMigrationType]?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the CSSQLiteStore instance

    +
    +
    + + error + + +
    +

    the NSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    a CSMigrationType array indicating the migration steps required for the store, or an empty array if the file does not exist yet. Otherwise, nil is returned and the error argument is set if either inspection of the store failed, or if no mapping model was found/inferred.

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + monitorObject(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a CSObjectMonitor for the specified NSManagedObject. Multiple ObjectObservers may then register themselves to be notified when changes are made to the NSManagedObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func monitorObject(_ object: NSManagedObject) -> CSObjectMonitor
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject to observe changes from

    +
    +
    +
    +
    +

    Return Value

    +

    a ObjectMonitor that monitors changes to object

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a CSListMonitor for a list of NSManagedObjects that satisfy the specified fetch clauses. Multiple CSListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func monitorListFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> CSListMonitor
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a CSListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a CSListMonitor for a list of NSManagedObjects that satisfy the specified fetch clauses. Multiple CSListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func monitorListByCreatingAsynchronously(_ createAsynchronously: @escaping (CSListMonitor) -> Void, from: CSFrom, fetchClauses: [CSFetchClause])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created CSListMonitor instance

    +
    +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for fetching the object list. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a CSListMonitor for a sectioned list of NSManagedObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func monitorSectionedListFrom(_ from: CSFrom, sectionBy: CSSectionBy, fetchClauses: [CSFetchClause]) -> CSListMonitor
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a CSSectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a CSListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a CSListMonitor for a sectioned list of NSManagedObjects that satisfy the specified fetch clauses. Multiple CSListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorSectionedListByCreatingAsynchronously(_ createAsynchronously: @escaping (CSListMonitor) -> Void, from: CSFrom, sectionBy: CSSectionBy, fetchClauses: [CSFetchClause])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created CSListMonitor instance

    +
    +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a CSSectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for fetching the object list. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Fetches the NSManagedObject instance in the transaction’s context from a reference created from a transaction or from a different managed object context.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchExistingObject(_ object: NSManagedObject) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    a reference to the object created/fetched outside the transaction

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject instance if the object exists in the transaction, or nil if not found.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches the NSManagedObject instance in the transaction’s context from an NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchExistingObjectWithID(_ objectID: NSManagedObjectID) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objectID + + +
    +

    the NSManagedObjectID for the object

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject instance if the object exists in the transaction, or nil if not found.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches the NSManagedObject instances in the transaction’s context from references created from a transaction or from a different managed object context.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchExistingObjects(_ objects: [NSManagedObject]) -> [Any]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objects + + +
    +

    an array of NSManagedObjects created/fetched outside the transaction

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject array for objects that exists in the transaction

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches the NSManagedObject instances in the transaction’s context from a list of NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchExistingObjectsWithIDs(_ objectIDs: [NSManagedObjectID]) -> [Any]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objectIDs + + +
    +

    the NSManagedObjectID array for the objects

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject array for objects that exists in the transaction

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches the first NSManagedObject instance that satisfies the specified CSFetchClauses. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchOneFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for the fetch request. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the first NSManagedObject instance that satisfies the specified CSFetchClauses

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches all NSManagedObject instances that satisfy the specified CSFetchClauses. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchAllFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> [Any]?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for the fetch request. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    all NSManagedObject instances that satisfy the specified CSFetchClauses

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches the number of NSManagedObjects that satisfy the specified CSFetchClauses. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchCountFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> NSNumber?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for the fetch request. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the number NSManagedObjects that satisfy the specified CSFetchClauses

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for the first NSManagedObject that satisfies the specified CSFetchClauses. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchObjectIDFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> NSManagedObjectID?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of CSFetchClause instances for the fetch request. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first NSManagedObject that satisfies the specified CSFetchClauses

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for all NSManagedObjects that satisfy the specified CSFetchClauses. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func fetchObjectIDsFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> [NSManagedObjectID]?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts CSWhere, CSOrderBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for all NSManagedObjects that satisfy the specified CSFetchClauses

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Queries aggregate values as specified by the CSQueryClauses. Requires at least a CSSelect clause, and optional CSWhere, CSOrderBy, CSGroupBy, and CSTweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func queryValueFrom(_ from: CSFrom, selectClause: CSSelect, queryClauses: [CSQueryClause]) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a CSSelect clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of CSQueryClause instances for the query request. Accepts CSWhere, CSOrderBy, CSGroupBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the CSSelect parameter.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Queries a dictionary of attribute values as specified by the CSQueryClauses. Requires at least a CSSelect clause, and optional CSWhere, CSOrderBy, CSGroupBy, and CSTweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func queryAttributesFrom(_ from: CSFrom, selectClause: CSSelect, queryClauses: [CSQueryClause]) -> [[String : Any]]?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a CSFrom clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a CSSelect clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of CSQueryClause instances for the query request. Accepts CSWhere, CSOrderBy, CSGroupBy, and CSTweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the CSSelect parameter.

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + beginAsynchronous(_:) + +
    +
    +
    +
    +
    +
    +

    Begins a transaction asynchronously where NSManagedObject creates, updates, and deletes can be made.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func beginAsynchronous(_ closure: @escaping (_ transaction: CSAsynchronousDataTransaction) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + closure + + +
    +

    the block where creates, updates, and deletes can be made to the transaction. Transaction blocks are executed serially in a background queue, and all changes are made from a concurrent NSManagedObjectContext.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Begins a transaction synchronously where NSManagedObject creates, updates, and deletes can be made.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func beginSynchronous(_ closure: @escaping (_ transaction: CSSynchronousDataTransaction) -> Void, error: NSErrorPointer) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + closure + + +
    +

    the block where creates, updates, and deletes can be made to the transaction. Transaction blocks are executed serially in a background queue, and all changes are made from a concurrent NSManagedObjectContext.

    +
    +
    + + error + + +
    +

    the CSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    YES if the commit succeeded, NO if the commit failed. If NO, the error argument will hold error information.

    +
    +
    +
    +
  • +
  • +
    + + + + beginUnsafe() + +
    +
    +
    +
    +
    +
    +

    Begins a child transaction where NSManagedObject creates, updates, and deletes can be made. This is useful for making temporary changes, such as partially filled forms.

    + +

    To support undo methods such as -undo, -redo, and -rollback, use the -beginSafeWithSupportsUndo: method passing YES to the argument. Without undo support, calling those methods will raise an exception.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func beginUnsafe() -> CSUnsafeDataTransaction
    + +
    +
    +
    +

    Return Value

    +

    a CSUnsafeDataTransaction instance where creates, updates, and deletes can be made.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Begins a child transaction where NSManagedObject creates, updates, and deletes can be made. This is useful for making temporary changes, such as partially filled forms.

    + +
      +
    • prameter supportsUndo: -undo, -redo, and -rollback methods are only available when this parameter is YES, otherwise those method will raise an exception. Note that turning on Undo support may heavily impact performance especially on iOS or watchOS where memory is limited.
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func beginUnsafeWithSupportsUndo(_ supportsUndo: Bool) -> CSUnsafeDataTransaction
    + +
    +
    +
    +

    Return Value

    +

    a CSUnsafeDataTransaction instance where creates, updates, and deletes can be made.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Refreshes all registered objects NSManagedObjects in the DataStack.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func refreshAndMergeAllObjects()
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSError.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSError.html new file mode 100644 index 0000000..ff64ae0 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSError.html @@ -0,0 +1,891 @@ + + + + CSError Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSError

+
+
+
@objc
+public final class CSError : NSError, CoreStoreObjectiveCType
+ +
+
+

All errors thrown from CoreStore are expressed in CSErrors.

+
+

See also

+ CoreStoreError + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + errorDomain + +
    +
    +
    +
    +
    +
    +

    The NSError error domain for CSError.

    +
    +

    See also

    + CoreStoreErrorErrorDomain + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static let errorDomain: String
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + bridgeToSwift + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var bridgeToSwift: CoreStoreError { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Do not call directly!

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ swiftValue: CoreStoreError)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSFrom.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSFrom.html new file mode 100644 index 0000000..513906f --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSFrom.html @@ -0,0 +1,1025 @@ + + + + CSFrom Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSFrom

+
+
+
@objc
+public final class CSFrom : NSObject
+ +
+
+

The CSFrom serves as the Objective-C bridging type for From.

+
+

See also

+ From + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + entityClass + +
    +
    +
    +
    +
    +
    +

    The associated NSManagedObject entity class

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var entityClass: AnyClass { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + configurations + +
    +
    +
    +
    +
    +
    +

    The NSPersistentStore configuration names to associate objects from. +May contain NSString instances to pertain to named configurations, or NSNull to pertain to the default configuration

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var configurations: [Any]? { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(entityClass:) + +
    +
    +
    +
    +
    +
    +

    Initializes a CSFrom clause with the specified entity class.

    +
    MyPersonEntity *people = [transaction fetchAllFrom:CSFromClass([MyPersonEntity class])];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(entityClass: NSManagedObject.Type)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entityClass + + +
    +

    the NSManagedObject class type to be created

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a CSFrom clause with the specified configurations.

    +
    MyPersonEntity *people = [transaction fetchAllFrom:
    +   CSFromClass([MyPersonEntity class], @"Config1")];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(entityClass: NSManagedObject.Type, configuration: Any)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + entityClass + + +
    +

    the associated NSManagedObject entity class

    +
    +
    + + configuration + + +
    +

    the NSPersistentStore configuration name to associate objects from. This parameter is required if multiple configurations contain the created NSManagedObject‘s entity type. Set to [NSNull null] to use the default configuration.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a CSFrom clause with the specified configurations.

    +
    MyPersonEntity *people = [transaction fetchAllFrom:
    +   CSFromClass([MyPersonEntity class],
    +                @[[NSNull null], @"Config1"])];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(entityClass: NSManagedObject.Type, configurations: [Any])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + entityClass + + +
    +

    the associated NSManagedObject entity class

    +
    +
    + + configurations + + +
    +

    an array of the NSPersistentStore configuration names to associate objects from. This parameter is required if multiple configurations contain the created NSManagedObject‘s entity type. Set to [NSNull null] to use the default configuration.

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSGroupBy.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSGroupBy.html new file mode 100644 index 0000000..c8cb959 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSGroupBy.html @@ -0,0 +1,916 @@ + + + + CSGroupBy Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSGroupBy

+
+
+
@objc
+public final class CSGroupBy : NSObject, CSQueryClause
+ +
+
+

The CSGroupBy serves as the Objective-C bridging type for GroupBy.

+
+

See also

+ GroupBy + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + keyPaths + +
    +
    +
    +
    +
    +
    +

    The list of key path strings to group results with

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var keyPaths: [KeyPathString] { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(keyPath:) + +
    +
    +
    +
    +
    +
    +

    Initializes a CSGroupBy clause with a key path string

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(keyPath: KeyPathString)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    a key path string to group results with

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(keyPaths:) + +
    +
    +
    +
    +
    +
    +

    Initializes a CSGroupBy clause with a list of key path strings

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(keyPaths: [KeyPathString])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPaths + + +
    +

    a list of key path strings to group results with

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSInMemoryStore.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSInMemoryStore.html new file mode 100644 index 0000000..9e5ca97 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSInMemoryStore.html @@ -0,0 +1,1027 @@ + + + + CSInMemoryStore Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSInMemoryStore

+
+
+
@objc
+public final class CSInMemoryStore : NSObject, CSStorageInterface, CoreStoreObjectiveCType
+ +
+
+

The CSInMemoryStore serves as the Objective-C bridging type for InMemoryStore.

+
+

See also

+ InMemoryStore + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + init(configuration:) + +
    +
    +
    +
    +
    +
    +

    Initializes a CSInMemoryStore for the specified configuration

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(configuration: ModelConfiguration)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + configuration + + +
    +

    an optional configuration name from the model file. If not specified, defaults to nil, the Default configuration.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes a CSInMemoryStore with the Default configuration

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience override init()
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + storeType + +
    +
    +
    +
    +
    +
    +

    The string identifier for the NSPersistentStore‘s type property. For CSInMemoryStores, this is always set to NSInMemoryStoreType.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static let storeType: String
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    +

    The configuration name in the model file

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var configuration: ModelConfiguration { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + storeOptions + +
    +
    +
    +
    +
    +
    +

    The options dictionary for the NSPersistentStore. For CSInMemoryStores, this is always set to nil.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var storeOptions: [AnyHashable : Any]? { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + bridgeToSwift + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let bridgeToSwift: InMemoryStore
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init(_ swiftValue: InMemoryStore)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSInto.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSInto.html new file mode 100644 index 0000000..bc66942 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSInto.html @@ -0,0 +1,963 @@ + + + + CSInto Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSInto

+
+
+
@objc
+public final class CSInto : NSObject
+ +
+
+

The CSInto serves as the Objective-C bridging type for Into<T>.

+
+

See also

+ Into + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + entityClass + +
    +
    +
    +
    +
    +
    +

    The associated NSManagedObject entity class

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var entityClass: NSManagedObject.Type { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    +

    The NSPersistentStore configuration name to associate objects from. +May contain a String to pertain to a named configuration, or nil to pertain to the default configuration

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var configuration: ModelConfiguration { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(entityClass:) + +
    +
    +
    +
    +
    +
    +

    Initializes a CSInto clause with the specified entity class.

    +
    MyPersonEntity *person = [transaction createInto:
    +   CSIntoClass([MyPersonEntity class])];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(entityClass: NSManagedObject.Type)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entityClass + + +
    +

    the NSManagedObject class type to be created

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a CSInto clause with the specified configuration.

    +
    MyPersonEntity *person = [transaction createInto:
    +   CSIntoClass([MyPersonEntity class])];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(entityClass: NSManagedObject.Type, configuration: ModelConfiguration)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + entityClass + + +
    +

    the NSManagedObject class type to be created

    +
    +
    + + configuration + + +
    +

    the NSPersistentStore configuration name to associate the object to. This parameter is required if multiple configurations contain the created NSManagedObject‘s entity type. Set to nil to use the default configuration.

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSListMonitor.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSListMonitor.html new file mode 100644 index 0000000..d53712d --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSListMonitor.html @@ -0,0 +1,2152 @@ + + + + CSListMonitor Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSListMonitor

+
+
+
@available(OSX 10.12, *)
+@objc
+public final class CSListMonitor : NSObject
+ +
+
+

The CSListMonitor serves as the Objective-C bridging type for ListMonitor<T>.

+
+

See also

+ ListMonitor + +
+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the object at the given index within the first section. This subscript indexer is typically used for CSListMonitors created without section groupings.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public subscript(index: Int) -> Any { get }
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + index + + +
    +

    the index of the object. Using an index above the valid range will raise an exception.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject at the specified index

    +
    +
    +
    +
  • +
  • +
    + + + + objectAtSafeIndex(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the object at the given index, or nil if out of bounds. This indexer is typically used for CSListMonitors created without section groupings.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func objectAtSafeIndex(_ index: Int) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + index + + +
    +

    the index for the object. Using an index above the valid range will return nil.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject at the specified index, or nil if out of bounds

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the object at the given sectionIndex and itemIndex. This indexer is typically used for CSListMonitors created as sectioned lists.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func objectAtSectionIndex(_ sectionIndex: Int, itemIndex: Int) -> Any
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionIndex + + +
    +

    the section index for the object. Using a sectionIndex with an invalid range will raise an exception.

    +
    +
    + + itemIndex + + +
    +

    the index for the object within the section. Using an itemIndex with an invalid range will raise an exception.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject at the specified section and item index

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the object at the given section and item index, or nil if out of bounds. This indexer is typically used for CSListMonitors created as sectioned lists.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func objectAtSafeSectionIndex(_ sectionIndex: Int, safeItemIndex itemIndex: Int) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionIndex + + +
    +

    the section index for the object. Using a sectionIndex with an invalid range will return nil.

    +
    +
    + + itemIndex + + +
    +

    the index for the object within the section. Using an itemIndex with an invalid range will return nil.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject at the specified section and item index, or nil if out of bounds

    +
    +
    +
    +
  • +
  • +
    + + + + objectAtIndexPath(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the object at the given NSIndexPath. This subscript indexer is typically used for CSListMonitors created as sectioned lists.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func objectAtIndexPath(_ indexPath: IndexPath) -> Any
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + indexPath + + +
    +

    the NSIndexPath for the object. Using an indexPath with an invalid range will raise an exception.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject at the specified index path

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the object at the given NSIndexPath, or nil if out of bounds. This subscript indexer is typically used for CSListMonitors created as sectioned lists.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func objectAtSafeIndexPath(_ indexPath: IndexPath) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + indexPath + + +
    +

    the NSIndexPath for the object. Using an indexPath with an invalid range will return nil.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObject at the specified index path, or nil if out of bounds

    +
    +
    +
    +
  • +
  • +
    + + + + hasObjects() + +
    +
    +
    +
    +
    +
    +

    Checks if the CSListMonitor has at least one object in any section.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func hasObjects() -> Bool
    + +
    +
    +
    +

    Return Value

    +

    YES if at least one object in any section exists, NO otherwise

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Checks if the CSListMonitor has at least one object the specified section.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func hasObjectsInSection(_ section: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will return NO.

    +
    +
    +
    +
    +

    Return Value

    +

    YES if at least one object in the specified section exists, NO otherwise

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns all objects in all sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func objectsInAllSections() -> [NSManagedObject]
    + +
    +
    +
    +

    Return Value

    +

    all objects in all sections

    +
    +
    +
    +
  • +
  • +
    + + + + objectsInSection(_:) + +
    +
    +
    +
    +
    +
    +

    Returns all objects in the specified section

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func objectsInSection(_ section: Int) -> [NSManagedObject]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will raise an exception.

    +
    +
    +
    +
    +

    Return Value

    +

    all objects in the specified section

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns all objects in the specified section, or nil if out of bounds.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func objectsInSafeSection(safeSectionIndex section: Int) -> [NSManagedObject]?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will return nil.

    +
    +
    +
    +
    +

    Return Value

    +

    all objects in the specified section, or nil if out of bounds

    +
    +
    +
    +
  • +
  • +
    + + + + numberOfSections() + +
    +
    +
    +
    +
    +
    +

    Returns the number of sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func numberOfSections() -> Int
    + +
    +
    +
    +

    Return Value

    +

    the number of sections

    +
    +
    +
    +
  • +
  • +
    + + + + numberOfObjects() + +
    +
    +
    +
    +
    +
    +

    Returns the number of objects in all sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func numberOfObjects() -> Int
    + +
    +
    +
    +

    Return Value

    +

    the number of objects in all sections

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the number of objects in the specified section

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func numberOfObjectsInSection(_ section: Int) -> Int
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will raise an exception.

    +
    +
    +
    +
    +

    Return Value

    +

    the number of objects in the specified section

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the number of objects in the specified section, or nil if out of bounds.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func numberOfObjectsInSafeSection(safeSectionIndex section: Int) -> NSNumber?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will return nil.

    +
    +
    +
    +
    +

    Return Value

    +

    the number of objects in the specified section, or nil if out of bounds

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the NSFetchedResultsSectionInfo for the specified section

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func sectionInfoAtIndex(_ section: Int) -> NSFetchedResultsSectionInfo
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will raise an exception.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSFetchedResultsSectionInfo for the specified section

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the NSFetchedResultsSectionInfo for the specified section, or nil if out of bounds.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func sectionInfoAtSafeSectionIndex(safeSectionIndex section: Int) -> NSFetchedResultsSectionInfo?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will return nil.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSFetchedResultsSectionInfo for the specified section, or nil if the section index is out of bounds.

    +
    +
    +
    +
  • +
  • +
    + + + + sections() + +
    +
    +
    +
    +
    +
    +

    Returns the NSFetchedResultsSectionInfos for all sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func sections() -> [NSFetchedResultsSectionInfo]
    + +
    +
    +
    +

    Return Value

    +

    the NSFetchedResultsSectionInfos for all sections

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the target section for a specified Section Index title and index.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func targetSectionForSectionIndexTitle(title: String, index: Int) -> Int
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + title + + +
    +

    the title of the Section Index

    +
    +
    + + index + + +
    +

    the index of the Section Index

    +
    +
    +
    +
    +

    Return Value

    +

    the target section for the specified Section Index title and index.

    +
    +
    +
    +
  • +
  • +
    + + + + sectionIndexTitles() + +
    +
    +
    +
    +
    +
    +

    Returns the section index titles for all sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func sectionIndexTitles() -> [String]
    + +
    +
    +
    +

    Return Value

    +

    the section index titles for all sections

    +
    +
    +
    +
  • +
  • +
    + + + + indexOf(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the index of the NSManagedObject if it exists in the CSListMonitor‘s fetched objects, or nil if not found.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func indexOf(_ object: NSManagedObject) -> NSNumber?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject to search the index of

    +
    +
    +
    +
    +

    Return Value

    +

    the index of the NSManagedObject if it exists in the CSListMonitor‘s fetched objects, or nil if not found.

    +
    +
    +
    +
  • +
  • +
    + + + + indexPathOf(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the NSIndexPath of the NSManagedObject if it exists in the CSListMonitor‘s fetched objects, or nil if not found.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func indexPathOf(_ object: NSManagedObject) -> IndexPath?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject to search the index of

    +
    +
    +
    +
    +

    Return Value

    +

    the NSIndexPath of the NSManagedObject if it exists in the ListMonitor‘s fetched objects, or nil if not found.

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + addListObserver(_:) + +
    +
    +
    +
    +
    +
    +

    Registers a CSListObserver to be notified when changes to the receiver’s list occur.

    + +

    To prevent retain-cycles, CSListMonitor only keeps weak references to its observers.

    + +

    For thread safety, this method needs to be called from the main thread. An assertion failure will occur (on debug builds only) if called from any thread other than the main thread.

    + +

    Calling -addListObserver: multiple times on the same observer is safe, as CSListMonitor unregisters previous notifications to the observer before re-registering them.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func addListObserver(_ observer: CSListObserver)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + observer + + +
    +

    a CSListObserver to send change notifications to

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Registers a CSListObjectObserver to be notified when changes to the receiver’s list occur.

    + +

    To prevent retain-cycles, CSListMonitor only keeps weak references to its observers.

    + +

    For thread safety, this method needs to be called from the main thread. An assertion failure will occur (on debug builds only) if called from any thread other than the main thread.

    + +

    Calling -addListObjectObserver: multiple times on the same observer is safe, as ListMonitor unregisters previous notifications to the observer before re-registering them.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func addListObjectObserver(_ observer: CSListObjectObserver)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + observer + + +
    +

    a CSListObjectObserver to send change notifications to

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Registers a CSListSectionObserver to be notified when changes to the receiver’s list occur.

    + +

    To prevent retain-cycles, CSListMonitor only keeps weak references to its observers.

    + +

    For thread safety, this method needs to be called from the main thread. An assertion failure will occur (on debug builds only) if called from any thread other than the main thread.

    + +

    Calling -addListSectionObserver: multiple times on the same observer is safe, as ListMonitor unregisters previous notifications to the observer before re-registering them.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func addListSectionObserver(_ observer: CSListSectionObserver)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + observer + + +
    +

    a CSListSectionObserver to send change notifications to

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Unregisters a CSListObserver from receiving notifications for changes to the receiver’s list.

    + +

    For thread safety, this method needs to be called from the main thread. An assertion failure will occur (on debug builds only) if called from any thread other than the main thread.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func removeListObserver(_ observer: CSListObserver)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + observer + + +
    +

    a CSListObserver to unregister notifications to

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + isPendingRefetch + +
    +
    +
    +
    +
    +
    +

    Returns YES if a call to -refetch: was made to the CSListMonitor and is currently waiting for the fetching to complete. Returns NO otherwise.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var isPendingRefetch: Bool { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + refetch(_:) + +
    +
    +
    +
    +
    +
    +

    Asks the CSListMonitor to refetch its objects using the specified series of CSFetchClauses. Note that this method does not execute the fetch immediately; the actual fetching will happen after the NSFetchedResultsController‘s last controllerDidChangeContent(_:) notification completes.

    + +

    refetch(...) broadcasts listMonitorWillRefetch(...) to its observers immediately, and then listMonitorDidRefetch(...) after the new fetch request completes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func refetch(_ fetchClauses: [CSFetchClause])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses. Note that only specified clauses will be changed; unspecified clauses will use previous values.

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSMigrationResult.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSMigrationResult.html new file mode 100644 index 0000000..9039352 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSMigrationResult.html @@ -0,0 +1,1128 @@ + + + + CSMigrationResult Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSMigrationResult

+
+
+
@objc
+public final class CSMigrationResult : NSObject, CoreStoreObjectiveCType
+ +
+
+

The CSMigrationResult serves as the Objective-C bridging type for MigrationResult.

+
+

See also

+ MigrationResult + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + isSuccess + +
    +
    +
    +
    +
    +
    +

    YES if the migration succeeded, NO otherwise

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var isSuccess: Bool { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + isFailure + +
    +
    +
    +
    +
    +
    +

    YES if the migration failed, NO otherwise

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var isFailure: Bool { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + migrationTypes + +
    +
    +
    +
    +
    +
    +

    YES if the migration succeeded, NO otherwise

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var migrationTypes: [CSMigrationType]? { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + error + +
    +
    +
    +
    +
    +
    +

    The NSError for a failed migration, or nil if the migration succeeded

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var error: NSError? { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    If the result was a success, the success block is executed with an array of CSMigrationTypes that indicates the migration steps completed. If the result was a failure, the failure block is executed with an NSError argument pertaining to the actual error.

    + +

    The blocks are executed immediately as @noescape and will not be retained.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func handleSuccess(_ success: (_ migrationTypes: [CSMigrationType]) -> Void, failure: (_ error: NSError) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + success + + +
    +

    the block to execute on success. The block passes an array of CSMigrationTypes that indicates the migration steps completed.

    +
    +
    + + failure + + +
    +

    the block to execute on failure. The block passes an NSError argument that pertains to the actual error.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + handleSuccess(_:) + +
    +
    +
    +
    +
    +
    +

    If the result was a success, the success block is executed with an array of CSMigrationTypes that indicates the migration steps completed. If the result was a failure, this method does nothing.

    + +

    The block is executed immediately as @noescape and will not be retained.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func handleSuccess(_ success: (_ migrationTypes: [CSMigrationType]) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + success + + +
    +

    the block to execute on success. The block passes an array of CSMigrationTypes that indicates the migration steps completed.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + handleFailure(_:) + +
    +
    +
    +
    +
    +
    +

    If the result was a failure, the failure block is executed with an NSError argument pertaining to the actual error. If the result was a success, this method does nothing.

    + +

    The block is executed immediately as @noescape and will not be retained.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func handleFailure(_ failure: (_ error: NSError) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + failure + + +
    +

    the block to execute on failure. The block passes an NSError argument that pertains to the actual error.

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + bridgeToSwift + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let bridgeToSwift: MigrationResult
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init(_ swiftValue: MigrationResult)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSMigrationType.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSMigrationType.html new file mode 100644 index 0000000..681b658 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSMigrationType.html @@ -0,0 +1,997 @@ + + + + CSMigrationType Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSMigrationType

+
+
+
@objc
+public final class CSMigrationType : NSObject, CoreStoreObjectiveCType
+ +
+
+

The CSMigrationType serves as the Objective-C bridging type for MigrationType.

+
+

See also

+ MigrationType + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + needsMigration + +
    +
    +
    +
    +
    +
    +

    Returns YES if the CSMigrationType‘s sourceVersion and destinationVersion do not match. Returns NO otherwise.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var needsMigration: Bool { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + sourceVersion + +
    +
    +
    +
    +
    +
    +

    Returns the source model version for the migration type. If no migration is required, sourceVersion will be equal to the destinationVersion.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var sourceVersion: String { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + destinationVersion + +
    +
    +
    +
    +
    +
    +

    Returns the destination model version for the migration type. If no migration is required, destinationVersion will be equal to the sourceVersion.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var destinationVersion: String { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns YES if the CSMigrationType is a lightweight migration. Used as syntactic sugar.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var isLightweightMigration: Bool { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns YES if the CSMigrationType is a heavyweight migration. Used as syntactic sugar.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var isHeavyweightMigration: Bool { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + bridgeToSwift + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let bridgeToSwift: MigrationType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init(_ swiftValue: MigrationType)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSObjectMonitor.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSObjectMonitor.html new file mode 100644 index 0000000..e6c502b --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSObjectMonitor.html @@ -0,0 +1,949 @@ + + + + CSObjectMonitor Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSObjectMonitor

+
+
+
@available(OSX 10.12, *)
+@objc
+public final class CSObjectMonitor : NSObject
+ +
+
+

The CSObjectMonitor serves as the Objective-C bridging type for ObjectMonitor<T>.

+
+

See also

+ ObjectMonitor + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + object + +
    +
    +
    +
    +
    +
    +

    Returns the NSManagedObject instance being observed, or nil if the object was already deleted.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var object: Any? { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + isObjectDeleted + +
    +
    +
    +
    +
    +
    +

    Returns YES if the NSManagedObject instance being observed still exists, or NO if the object was already deleted.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isObjectDeleted: Bool { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + addObjectObserver(_:) + +
    +
    +
    +
    +
    +
    +

    Registers a CSObjectObserver to be notified when changes to the receiver’s object are made.

    + +

    To prevent retain-cycles, CSObjectMonitor only keeps weak references to its observers.

    + +

    For thread safety, this method needs to be called from the main thread. An assertion failure will occur (on debug builds only) if called from any thread other than the main thread.

    + +

    Calling -addObjectObserver: multiple times on the same observer is safe, as CSObjectMonitor unregisters previous notifications to the observer before re-registering them.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func addObjectObserver(_ observer: CSObjectObserver)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + observer + + +
    +

    an CSObjectObserver to send change notifications to

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Unregisters an CSObjectObserver from receiving notifications for changes to the receiver’s object.

    + +

    For thread safety, this method needs to be called from the main thread. An assertion failure will occur (on debug builds only) if called from any thread other than the main thread.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func removeObjectObserver(_ observer: CSObjectObserver)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + observer + + +
    +

    an CSObjectObserver to unregister notifications to

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSOrderBy.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSOrderBy.html new file mode 100644 index 0000000..2cff801 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSOrderBy.html @@ -0,0 +1,924 @@ + + + + CSOrderBy Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSOrderBy

+
+
+
@objc
+public final class CSOrderBy : NSObject, CSFetchClause, CSQueryClause, CSDeleteClause
+ +
+
+

The CSOrderBy serves as the Objective-C bridging type for OrderBy.

+
+

See also

+ OrderBy + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + sortDescriptors + +
    +
    +
    +
    +
    +
    +

    The list of sort descriptors

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var sortDescriptors: [NSSortDescriptor] { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(sortDescriptor:) + +
    +
    +
    +
    +
    +
    +

    Initializes a CSOrderBy clause with a single sort descriptor

    +
    MyPersonEntity *people = [transaction
    +   fetchAllFrom:CSFromClass([MyPersonEntity class])
    +   fetchClauses:@[CSOrderByKey(CSSortAscending(@"fullname"))]]];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(sortDescriptor: NSSortDescriptor)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sortDescriptor + + +
    +

    a NSSortDescriptor

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a CSOrderBy clause with a list of sort descriptors

    +
    MyPersonEntity *people = [transaction
    +   fetchAllFrom:CSFromClass([MyPersonEntity class])
    +   fetchClauses:@[CSOrderByKeys(CSSortAscending(@"fullname"), CSSortDescending(@"age"), nil))]]];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(sortDescriptors: [NSSortDescriptor])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sortDescriptors + + +
    +

    an array of NSSortDescriptors

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSSQLiteStore.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSSQLiteStore.html new file mode 100644 index 0000000..8437259 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSSQLiteStore.html @@ -0,0 +1,1250 @@ + + + + CSSQLiteStore Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSSQLiteStore

+
+
+
@objc
+public final class CSSQLiteStore : NSObject, CSLocalStorage, CoreStoreObjectiveCType
+ +
+
+

The CSSQLiteStore serves as the Objective-C bridging type for SQLiteStore.

+
+

See also

+ SQLiteStore + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes an SQLite store interface from the given SQLite file URL. When this instance is passed to the CSDataStack‘s -addStorage*: methods, a new SQLite file will be created if it does not exist.

    +
    +

    Important

    + Initializing CSSQLiteStores with custom migration mapping models is currently not supported. Create an SQLiteStore instance from Swift code and bridge the instance to Objective-C using its SQLiteStore.bridgeToObjectiveC property. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(fileURL: URL, configuration: ModelConfiguration, localStorageOptions: Int)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + fileURL + + +
    +

    the local file URL for the target SQLite persistent store. Note that if you have multiple configurations, you will need to specify a different fileURL explicitly for each of them.

    +
    +
    + + configuration + + +
    +

    an optional configuration name from the model file. If not specified, defaults to nil, the Default configuration. Note that if you have multiple configurations, you will need to specify a different fileURL explicitly for each of them.

    +
    +
    + + localStorageOptions + + +
    +

    When the CSSQLiteStore is passed to the CSDataStack‘s addStorage() methods, tells the CSDataStack how to setup the persistent store. Defaults to CSLocalStorageOptionsNone.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes an SQLite store interface from the given SQLite file name. When this instance is passed to the CSDataStack‘s -addStorage*: methods, a new SQLite file will be created if it does not exist.

    +
    +

    Important

    + Initializing CSSQLiteStores with custom migration mapping models is currently not supported. Create an SQLiteStore instance from Swift code and bridge the instance to Objective-C using its SQLiteStore.bridgeToObjectiveC property. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(fileName: String, configuration: ModelConfiguration, localStorageOptions: Int)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + fileName + + +
    +

    the local filename for the SQLite persistent store in the Application Support/ directory (or the Caches/ directory on tvOS). Note that if you have multiple configurations, you will need to specify a different fileName explicitly for each of them.

    +
    +
    + + configuration + + +
    +

    an optional configuration name from the model file. If not specified, defaults to nil, the Default configuration. Note that if you have multiple configurations, you will need to specify a different fileName explicitly for each of them.

    +
    +
    + + localStorageOptions + + +
    +

    When the CSSQLiteStore is passed to the CSDataStack‘s addStorage() methods, tells the CSDataStack how to setup the persistent store. Defaults to [CSLocalStorageOptions none].

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes an CSSQLiteStore with an all-default settings: a fileURL pointing to a .sqlite file in the Application Support/ directory (or the Caches/ directory on tvOS), a nil configuration pertaining to the Default configuration, and localStorageOptions set to [CSLocalStorageOptions none].

    +
    +

    Important

    + Initializing CSSQLiteStores with custom migration mapping models is currently not supported. Create an SQLiteStore instance from Swift code and bridge the instance to Objective-C using its SQLiteStore.bridgeToObjectiveC property. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience override init()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fileURL + +
    +
    +
    +
    +
    +
    +

    The NSURL that points to the SQLite file

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var fileURL: URL { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    An array of SchemaMappingProviders that provides the complete mapping models for custom migrations. This is currently only supported for Swift code.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var migrationMappingProviders: [Any] { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + localStorageOptions + +
    +
    +
    +
    +
    +
    +

    Options that tell the CSDataStack how to setup the persistent store

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var localStorageOptions: Int { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + storeType + +
    +
    +
    +
    +
    +
    +

    The string identifier for the NSPersistentStore‘s type property. For CSSQLiteStores, this is always set to NSSQLiteStoreType.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static let storeType: String
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    +

    The configuration name in the model file

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var configuration: ModelConfiguration { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + storeOptions + +
    +
    +
    +
    +
    +
    +

    The options dictionary for the NSPersistentStore. For CSSQLiteStores, this is always set to

    +
    [NSSQLitePragmasOption: ["journal_mode": "WAL"]]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var storeOptions: [AnyHashable : Any]? { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Called by the CSDataStack to perform actual deletion of the store file from disk. Do not call directly! The sourceModel argument is a hint for the existing store’s model version. For CSSQLiteStore, this converts the database’s WAL journaling mode to DELETE before deleting the file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func cs_eraseStorageAndWait(metadata: NSDictionary, soureModelHint: NSManagedObjectModel?, error: NSErrorPointer) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + bridgeToSwift + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let bridgeToSwift: SQLiteStore
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init(_ swiftValue: SQLiteStore)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSSectionBy.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSSectionBy.html new file mode 100644 index 0000000..06c207f --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSSectionBy.html @@ -0,0 +1,909 @@ + + + + CSSectionBy Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSSectionBy

+
+
+
@available(OSX 10.12, *)
+@objc
+public final class CSSectionBy : NSObject
+ +
+
+

The CSSectionBy serves as the Objective-C bridging type for SectionBy.

+
+

See also

+ SectionBy + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + keyPath(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a CSSectionBy clause with the key path to use to group CSListMonitor objects into sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func keyPath(_ sectionKeyPath: KeyPathString) -> CSSectionBy
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sectionKeyPath + + +
    +

    the key path to use to group the objects into sections

    +
    +
    +
    +
    +

    Return Value

    +

    a CSSectionBy clause with the key path to use to group CSListMonitor objects into sections

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a CSSectionBy clause with the key path to use to group CSListMonitor objects into sections, and a closure to transform the value for the key path to an appropriate section name

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func keyPath(_ sectionKeyPath: KeyPathString, sectionIndexTransformer: @escaping (_ sectionName: String?) -> String?) -> CSSectionBy
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionKeyPath + + +
    +

    the key path to use to group the objects into sections

    +
    +
    + + sectionIndexTransformer + + +
    +

    a closure to transform the value for the key path to an appropriate section name

    +
    +
    +
    +
    +

    Return Value

    +

    a CSSectionBy clause with the key path to use to group CSListMonitor objects into sections

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSSelect.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSSelect.html new file mode 100644 index 0000000..5b6b08b --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSSelect.html @@ -0,0 +1,1200 @@ + + + + CSSelect Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSSelect

+
+
+
@objc
+public final class CSSelect : NSObject
+ +
+
+

The CSSelect serves as the Objective-C bridging type for Select.

+
+

See also

+ Select + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + init(numberTerm:) + +
    +
    +
    +
    +
    +
    +

    Creates a CSSelect clause for querying NSNumber values.

    +
    NSNumber *maxAge = [CSCoreStore
    +   queryValueFrom:CSFromClass([MyPersonEntity class])
    +   select:CSSelectNumber(CSAggregateMax(@"age"))
    +   // ...
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(numberTerm: CSSelectTerm)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + numberTerm + + +
    +

    the CSSelectTerm specifying the attribute/aggregate value to query

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(decimalTerm:) + +
    +
    +
    +
    +
    +
    +

    Creates a CSSelect clause for querying NSDecimalNumber values.

    +
    NSDecimalNumber *averagePrice = [CSCoreStore
    +   queryValueFrom:CSFromClass([MyPersonEntity class])
    +   select:CSSelectDecimal(CSAggregateAverage(@"price"))
    +   // ...
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(decimalTerm: CSSelectTerm)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + decimalTerm + + +
    +

    the CSSelectTerm specifying the attribute/aggregate value to query

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(stringTerm:) + +
    +
    +
    +
    +
    +
    +

    Creates a CSSelect clause for querying NSString values.

    +
    NSString *fullname = [CSCoreStore
    +   queryValueFrom:CSFromClass([MyPersonEntity class])
    +   select:CSSelectString(CSAttribute(@"fullname"))
    +   // ...
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(stringTerm: CSSelectTerm)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + stringTerm + + +
    +

    the CSSelectTerm specifying the attribute/aggregate value to query

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(dateTerm:) + +
    +
    +
    +
    +
    +
    +

    Creates a CSSelect clause for querying NSDate values.

    +
    NSDate *lastUpdate = [CSCoreStore
    +   queryValueFrom:CSFromClass([MyPersonEntity class])
    +   select:CSSelectDate(CSAggregateMax(@"updatedDate"))
    +   // ...
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(dateTerm: CSSelectTerm)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + dateTerm + + +
    +

    the CSSelectTerm specifying the attribute/aggregate value to query

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(dataTerm:) + +
    +
    +
    +
    +
    +
    +

    Creates a CSSelect clause for querying NSData values.

    +
    NSData *imageData = [CSCoreStore
    +   queryValueFrom:CSFromClass([MyPersonEntity class])
    +   select:CSSelectData(CSAttribute(@"imageData"))
    +   // ...
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(dataTerm: CSSelectTerm)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + dataTerm + + +
    +

    the CSSelectTerm specifying the attribute/aggregate value to query

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(objectIDTerm:) + +
    +
    +
    +
    +
    +
    +

    Creates a CSSelect clause for querying NSManagedObjectID values.

    +
    NSManagedObjectID *objectID = [CSCoreStore
    +   queryValueFrom:CSFromClass([MyPersonEntity class])
    +   select:CSSelectObjectID()
    +   // ...
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(objectIDTerm: ())
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + dictionaryForTerm(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a CSSelect clause for querying NSDictionary of an entity’s attribute keys and values.

    +
    NSDictionary *keyValues = [CSCoreStore
    +    queryValueFrom:[CSFrom entityClass:[MyPersonEntity class]]
    +    select:[CSSelect dictionaryForTerm:[CSSelectTerm maximum:@"age" as:nil]]];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func dictionaryForTerm(_ term: CSSelectTerm) -> CSSelect
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + term + + +
    +

    the CSSelectTerm specifying the attribute/aggregate value to query

    +
    +
    +
    +
    +

    Return Value

    +

    a CSSelect clause for querying an entity attribute

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a CSSelect clause for querying NSDictionary of an entity’s attribute keys and values.

    +
    NSDictionary *keyValues = [CSCoreStore
    +    queryValueFrom:[CSFrom entityClass:[MyPersonEntity class]]
    +    select:[CSSelect dictionaryForTerms:@[
    +        [CSSelectTerm attribute:@"name" as:nil],
    +        [CSSelectTerm attribute:@"age" as:nil]
    +    ]]];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func dictionaryForTerms(_ terms: [CSSelectTerm]) -> CSSelect
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + terms + + +
    +

    the CSSelectTerms specifying the attribute/aggregate values to query

    +
    +
    +
    +
    +

    Return Value

    +

    a CSSelect clause for querying an entity attribute

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSSelectTerm.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSSelectTerm.html new file mode 100644 index 0000000..456f6cb --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSSelectTerm.html @@ -0,0 +1,1225 @@ + + + + CSSelectTerm Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSSelectTerm

+
+
+
@objc
+public final class CSSelectTerm : NSObject
+ +
+
+

The CSSelectTerm serves as the Objective-C bridging type for SelectTerm.

+
+

See also

+ SelectTerm + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + init(keyPath:) + +
    +
    +
    +
    +
    +
    +

    Provides a CSSelectTerm to a CSSelect clause for querying an entity attribute.

    +
    NSString *fullName = [CSCoreStore
    +    queryValueFrom:[CSFrom entityClass:[MyPersonEntity class]]
    +    select:CSSelectString(CSAttribute(@"fullname"))
    +    fetchClauses:@[[CSWhere keyPath:@"employeeID" isEqualTo: @1111]]];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(keyPath: KeyPathString)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + average(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a CSSelectTerm to a CSSelect clause for querying the average value of an attribute.

    +
    NSNumber *averageAge = [CSCoreStore
    +    queryValueFrom:[CSFrom entityClass:[MyPersonEntity class]]
    +    select:[CSSelect numberForTerm:[CSSelectTerm average:@"age" as:nil]]];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func average(_ keyPath: KeyPathString, as alias: KeyPathString?) -> CSSelectTerm
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    +
    +
    +

    Return Value

    +

    a CSSelectTerm to a CSSelect clause for querying the average value of an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + count(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a CSSelectTerm to a CSSelect clause for a count query.

    +
    NSNumber *numberOfEmployees = [CSCoreStore
    +    queryValueFrom:[CSFrom entityClass:[MyPersonEntity class]]
    +    select:[CSSelect numberForTerm:[CSSelectTerm count:@"employeeID" as:nil]]];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func count(_ keyPath: KeyPathString, as alias: KeyPathString?) -> CSSelectTerm
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key count() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for a count query

    +
    +
    +
    +
  • +
  • +
    + + + + maximum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a CSSelectTerm to a CSSelect clause for querying the maximum value for an attribute.

    +
    NSNumber *maximumAge = [CSCoreStore
    +    queryValueFrom:[CSFrom entityClass:[MyPersonEntity class]]
    +    select:[CSSelect numberForTerm:[CSSelectTerm maximum:@"age" as:nil]]];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func maximum(_ keyPath: KeyPathString, as alias: KeyPathString?) -> CSSelectTerm
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key max() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a CSSelectTerm to a CSSelect clause for querying the maximum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + minimum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a CSSelectTerm to a CSSelect clause for querying the minimum value for an attribute.

    +
    NSNumber *minimumAge = [CSCoreStore
    +    queryValueFrom:[CSFrom entityClass:[MyPersonEntity class]]
    +    select:[CSSelect numberForTerm:[CSSelectTerm minimum:@"age" as:nil]]];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func minimum(_ keyPath: KeyPathString, as alias: KeyPathString?) -> CSSelectTerm
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key min() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a CSSelectTerm to a CSSelect clause for querying the minimum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + sum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a CSSelectTerm to a CSSelect clause for querying the sum value for an attribute.

    +
    NSNumber *totalAge = [CSCoreStore
    +    queryValueFrom:[CSFrom entityClass:[MyPersonEntity class]]
    +    select:[CSSelect numberForTerm:[CSSelectTerm sum:@"age" as:nil]]];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func sum(_ keyPath: KeyPathString, as alias: KeyPathString?) -> CSSelectTerm
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key sum() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a CSSelectTerm to a CSSelect clause for querying the sum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + objectIDAs(_:) + +
    +
    +
    +
    +
    +
    +

    Provides a CSSelectTerm to a CSSelect clause for querying the NSManagedObjectID.

    +
    NSManagedObjectID *objectID = [CSCoreStore
    +    queryValueFrom:[CSFrom entityClass:[MyPersonEntity class]]
    +    select:[CSSelect objectIDForTerm:[CSSelectTerm objectIDAs:nil]]
    +    fetchClauses:@[[CSWhere keyPath:@"employeeID" isEqualTo: @1111]]];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public static func objectIDAs(_ alias: KeyPathString? = nil) -> CSSelectTerm
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key objecID is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the sum value for an attribute

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSSetupResult.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSSetupResult.html new file mode 100644 index 0000000..15d7e8f --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSSetupResult.html @@ -0,0 +1,1065 @@ + + + + CSSetupResult Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSSetupResult

+
+
+
@objc
+public final class CSSetupResult : NSObject
+ +
+
+

The CSSetupResult serves as the Objective-C bridging type for SetupResult.

+
+

See also

+ SetupResult + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + isSuccess + +
    +
    +
    +
    +
    +
    +

    YES if adding the CSStorageInterface to the CSDataStack succeeded, NO otherwise.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var isSuccess: Bool { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + isFailure + +
    +
    +
    +
    +
    +
    +

    YES if adding the CSStorageInterface to the CSDataStack failed, NO otherwise. When YES, the error property returns the actual NSError for the failure.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var isFailure: Bool { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + storage + +
    +
    +
    +
    +
    +
    +

    A CSStorageInterface instance if the commit operation for the transaction succeeded. Returns nil otherwise.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public let storage: CSStorageInterface?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + error + +
    +
    +
    +
    +
    +
    +

    The NSError for a failed commit operation, or nil if the commit succeeded

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public let error: NSError?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    If the result was a success, the success block is executed with the CSStorageInterface instance that was added to the CSDataStack. If the result was a failure, the failure block is executed with an NSError argument pertaining to the actual error.

    + +

    The blocks are executed immediately as @noescape and will not be retained.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func handleSuccess(_ success: (_ storage: CSStorageInterface) -> Void, failure: (_ error: NSError) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + success + + +
    +

    the block to execute on success. The block passes a CSStorageInterface instance that was added to the CSDataStack.

    +
    +
    + + failure + + +
    +

    the block to execute on failure. The block passes an NSError argument that pertains to the actual error.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + handleSuccess(_:) + +
    +
    +
    +
    +
    +
    +

    If the result was a success, the success block is executed with a BOOL argument that indicates if there were any changes made. If the result was a failure, this method does nothing.

    + +

    The block is executed immediately as @noescape and will not be retained.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func handleSuccess(_ success: (_ storage: CSStorageInterface) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + success + + +
    +

    the block to execute on success. The block passes a BOOL argument that indicates if there were any changes made.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + handleFailure(_:) + +
    +
    +
    +
    +
    +
    +

    If the result was a failure, the failure block is executed with an NSError argument pertaining to the actual error. If the result was a success, this method does nothing.

    + +

    The block is executed immediately as @noescape and will not be retained.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func handleFailure(_ failure: (_ error: NSError) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + failure + + +
    +

    the block to execute on failure. The block passes an NSError argument that pertains to the actual error.

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSSynchronousDataTransaction.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSSynchronousDataTransaction.html new file mode 100644 index 0000000..bea2862 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSSynchronousDataTransaction.html @@ -0,0 +1,1203 @@ + + + + CSSynchronousDataTransaction Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSSynchronousDataTransaction

+
+
+
@objc
+public final class CSSynchronousDataTransaction : CSBaseDataTransaction, CoreStoreObjectiveCType
+ +
+
+

The CSSynchronousDataTransaction serves as the Objective-C bridging type for SynchronousDataTransaction.

+
+

See also

+ SynchronousDataTransaction + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + commitAndWait(error:) + +
    +
    +
    +
    +
    +
    +

    Saves the transaction changes and waits for completion synchronously. This method should not be used after the -commitAndWaitWithError: method was already called once.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func commitAndWait(error: NSErrorPointer) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + error + + +
    +

    the CSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    YES if the commit succeeded, NO if the commit failed. If NO, the error argument will hold error information.

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + createInto(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a new NSManagedObject with the specified entity type.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public override func createInto(_ into: CSInto) -> Any
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + into + + +
    +

    the CSInto clause indicating the destination NSManagedObject entity type and the destination configuration

    +
    +
    +
    +
    +

    Return Value

    +

    a new NSManagedObject instance of the specified entity type.

    +
    +
    +
    +
  • +
  • +
    + + + + editObject(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an editable proxy of a specified NSManagedObject. This method should not be used after the -commitAndWait method was already called once.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public override func editObject(_ object: NSManagedObject?) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject type to be edited

    +
    +
    +
    +
    +

    Return Value

    +

    an editable proxy for the specified NSManagedObject.

    +
    +
    +
    +
  • +
  • +
    + + + + editInto(_:objectID:) + +
    +
    +
    +
    +
    +
    +

    Returns an editable proxy of the object with the specified NSManagedObjectID. This method should not be used after the -commitAndWait method was already called once.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public override func editInto(_ into: CSInto, objectID: NSManagedObjectID) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + into + + +
    +

    a CSInto clause specifying the entity type

    +
    +
    + + objectID + + +
    +

    the NSManagedObjectID for the object to be edited

    +
    +
    +
    +
    +

    Return Value

    +

    an editable proxy for the specified NSManagedObject.

    +
    +
    +
    +
  • +
  • +
    + + + + deleteObject(_:) + +
    +
    +
    +
    +
    +
    +

    Deletes a specified NSManagedObject. This method should not be used after the -commitAndWait method was already called once.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public override func deleteObject(_ object: NSManagedObject?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject type to be deleted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + deleteObjects(_:) + +
    +
    +
    +
    +
    +
    +

    Deletes the specified NSManagedObjects.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override func deleteObjects(_ objects: [NSManagedObject])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objects + + +
    +

    the NSManagedObjects to be deleted

    +
    +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSTweak.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSTweak.html new file mode 100644 index 0000000..45fa3c6 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSTweak.html @@ -0,0 +1,937 @@ + + + + CSTweak Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSTweak

+
+
+
@objc
+public final class CSTweak : NSObject, CSFetchClause, CSQueryClause, CSDeleteClause, CoreStoreObjectiveCType
+ +
+
+

The CSTweak serves as the Objective-C bridging type for Tweak.

+
+

See also

+ Tweak + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + block + +
    +
    +
    +
    +
    +
    +

    The block to customize the NSFetchRequest

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var block: (_ fetchRequest: NSFetchRequest<NSFetchRequestResult>) -> Void { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(block:) + +
    +
    +
    +
    +
    +
    +

    Initializes a CSTweak clause with a closure where the NSFetchRequest may be configured.

    +
    +

    Important

    + CSTweak‘s closure is executed only just before the fetch occurs, so make sure that any values captured by the closure is not prone to race conditions. Also, some utilities (such as CSListMonitors) may keep CSFetchClauses in memory and may thus introduce retain cycles if reference captures are not handled properly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(block: @escaping (_ fetchRequest: NSFetchRequest<NSFetchRequestResult>) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    the block to customize the NSFetchRequest

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + bridgeToSwift + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let bridgeToSwift: Tweak
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ swiftValue: Tweak)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSUnsafeDataModelSchema.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSUnsafeDataModelSchema.html new file mode 100644 index 0000000..eca085e --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSUnsafeDataModelSchema.html @@ -0,0 +1,981 @@ + + + + CSUnsafeDataModelSchema Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSUnsafeDataModelSchema

+
+
+
@objc
+public final class CSUnsafeDataModelSchema : NSObject, CSDynamicSchema, CoreStoreObjectiveCType
+ +
+
+

The CSUnsafeDataModelSchema serves as the Objective-C bridging type for UnsafeDataModelSchema.

+
+

See also

+ UnsafeDataModelSchema + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes a CSUnsafeDataModelSchema from an NSManagedObjectModel.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public required init(modelName: ModelVersion, model: NSManagedObjectModel)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + modelName + + +
    +

    the model version, typically the file name of an *.xcdatamodeld file (without the file extension)

    +
    +
    + + model + + +
    +

    the NSManagedObjectModel

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + modelVersion + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var modelVersion: ModelVersion { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + rawModel() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func rawModel() -> NSManagedObjectModel
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSUnsafeDataTransaction.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSUnsafeDataTransaction.html new file mode 100644 index 0000000..f23d3b9 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSUnsafeDataTransaction.html @@ -0,0 +1,1267 @@ + + + + CSUnsafeDataTransaction Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSUnsafeDataTransaction

+
+
+
@objc
+public final class CSUnsafeDataTransaction : CSBaseDataTransaction, CoreStoreObjectiveCType
+ +
+
+

The CSUnsafeDataTransaction serves as the Objective-C bridging type for UnsafeDataTransaction.

+
+

See also

+ UnsafeDataTransaction + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Saves the transaction changes asynchronously. For a CSUnsafeDataTransaction, multiple commits are allowed, although it is the developer’s responsibility to ensure a reasonable leeway to prevent blocking the main thread.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func commitWithSuccess(_ success: (() -> Void)?, _ failure: ((CSError) -> Void)?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + success + + +
    +

    the block executed if the save succeeds.

    +
    +
    + + failure + + +
    +

    the block executed if the save fails. A CSError is reported as the argument of the block.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + commitAndWait(error:) + +
    +
    +
    +
    +
    +
    +

    Saves the transaction changes and waits for completion synchronously. For a CSUnsafeDataTransaction, multiple commits are allowed, although it is the developer’s responsibility to ensure a reasonable leeway to prevent blocking the main thread.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func commitAndWait(error: NSErrorPointer) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + error + + +
    +

    the CSError pointer that indicates the reason in case of an failure

    +
    +
    +
    +
    +

    Return Value

    +

    YES if the commit succeeded, NO if the commit failed. If NO, the error argument will hold error information.

    +
    +
    +
    +
  • +
  • +
    + + + + rollback() + +
    +
    +
    +
    +
    +
    +

    Rolls back the transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func rollback()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + undo() + +
    +
    +
    +
    +
    +
    +

    Undo’s the last change made to the transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func undo()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + redo() + +
    +
    +
    +
    +
    +
    +

    Redo’s the last undone change to the transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func redo()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + flush() + +
    +
    +
    +
    +
    +
    +

    Immediately flushes all pending changes to the transaction’s observers. This is useful in conjunction with ListMonitors and ObjectMonitors created from UnsafeDataTransactions used to manage temporary scratch data.

    +
    +

    Important

    + Note that unlike commit(), flush() does not propagate/save updates to the DataStack and the persistent store. However, the flushed changes will be seen by children transactions created further from the current transaction (i.e. through transaction.beginUnsafe()) + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func flush()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + flush(_:) + +
    +
    +
    +
    +
    +
    +

    Flushes all pending changes to the transaction’s observers at the end of the closure‘s execution. This is useful in conjunction with ListMonitors and ObjectMonitors created from UnsafeDataTransactions used to manage temporary scratch data.

    +
    +

    Important

    + Note that unlike commit(), flush() does not propagate/save updates to the DataStack and the persistent store. However, the flushed changes will be seen by children transactions created further from the current transaction (i.e. through transaction.beginUnsafe()) + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func flush(_ block: () -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    the block where changes can be made prior to the flush

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + beginUnsafe() + +
    +
    +
    +
    +
    +
    +

    Begins a child transaction where NSManagedObject creates, updates, and deletes can be made. This is useful for making temporary changes, such as partially filled forms.

    + +

    To support undo methods such as -undo, -redo, and -rollback, use the -beginSafeWithSupportsUndo: method passing YES to the argument. Without undo support, calling those methods will raise an exception.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func beginUnsafe() -> CSUnsafeDataTransaction
    + +
    +
    +
    +

    Return Value

    +

    a CSUnsafeDataTransaction instance where creates, updates, and deletes can be made.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Begins a child transaction where NSManagedObject creates, updates, and deletes can be made. This is useful for making temporary changes, such as partially filled forms.

    + +
      +
    • prameter supportsUndo: -undo, -redo, and -rollback methods are only available when this parameter is YES, otherwise those method will raise an exception. Note that turning on Undo support may heavily impact performance especially on iOS or watchOS where memory is limited.
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func beginUnsafeWithSupportsUndo(_ supportsUndo: Bool) -> CSUnsafeDataTransaction
    + +
    +
    +
    +

    Return Value

    +

    a CSUnsafeDataTransaction instance where creates, updates, and deletes can be made.

    +
    +
    +
    +
  • +
  • +
    + + + + unsafeContext() + +
    +
    +
    +
    +
    +
    +

    Returns the NSManagedObjectContext for this unsafe transaction. Use only for cases where external frameworks need an NSManagedObjectContext instance to work with.

    + +

    Note that it is the developer’s responsibility to ensure the following:

    + +
      +
    • that the CSUnsafeDataTransaction that owns this context should be strongly referenced and prevented from being deallocated during the context’s lifetime
    • +
    • that all saves will be done either through the CSUnsafeDataTransaction‘s -commit: or -commitAndWait method, or by calling -save: manually on the context, its parent, and all other ancestor contexts if there are any.
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func unsafeContext() -> NSManagedObjectContext
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSWhere.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSWhere.html new file mode 100644 index 0000000..cf80c42 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSWhere.html @@ -0,0 +1,1102 @@ + + + + CSWhere Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSWhere

+
+
+
@objc
+public final class CSWhere : NSObject, CSFetchClause, CSQueryClause, CSDeleteClause
+ +
+
+

The CSWhere serves as the Objective-C bridging type for Where.

+
+

See also

+ Where + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + predicate + +
    +
    +
    +
    +
    +
    +

    The internal NSPredicate instance for the Where clause

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var predicate: NSPredicate { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(value:) + +
    +
    +
    +
    +
    +
    +

    Initializes a CSWhere clause with a predicate that always evaluates to the specified boolean value

    +
    MyPersonEntity *people = [transaction
    +   fetchAllFrom:CSFromClass([MyPersonEntity class])
    +   fetchClauses:@[CSWhereValue(YES)]]];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(value: Bool)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + value + + +
    +

    the boolean value for the predicate

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a CSWhere clause with a predicate using the specified string format and arguments

    +
    NSPredicate *predicate = // ...
    +MyPersonEntity *people = [transaction
    +   fetchAllFrom:CSFromClass([MyPersonEntity class])
    +   fetchClauses:@[CSWherePredicate(predicate)]];
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(format: String, argumentArray: [NSObject]?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + format + + +
    +

    the format string for the predicate

    +
    +
    + + argumentArray + + +
    +

    the arguments for format

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a CSWhere clause that compares equality

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(keyPath: KeyPathString, isEqualTo value: CoreDataNativeType?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + value + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a CSWhere clause that compares membership

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(keyPath: KeyPathString, isMemberOf list: [CoreDataNativeType])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + list + + +
    +

    the array to check membership of

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(predicate:) + +
    +
    +
    +
    +
    +
    +

    Initializes a CSWhere clause with an NSPredicate

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public convenience init(predicate: NSPredicate)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + predicate + + +
    +

    the NSPredicate for the fetch or query

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSXcodeDataModelSchema.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSXcodeDataModelSchema.html new file mode 100644 index 0000000..25865e6 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CSXcodeDataModelSchema.html @@ -0,0 +1,981 @@ + + + + CSXcodeDataModelSchema Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSXcodeDataModelSchema

+
+
+
@objc
+public final class CSXcodeDataModelSchema : NSObject, CSDynamicSchema, CoreStoreObjectiveCType
+ +
+
+

The CSXcodeDataModelSchema serves as the Objective-C bridging type for XcodeDataModelSchema.

+
+

See also

+ XcodeDataModelSchema + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes an CSXcodeDataModelSchema from an *.xcdatamodeld file URL.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public required init(modelName: ModelVersion, modelVersionFileURL: URL)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + modelName + + +
    +

    the model version, typically the file name of an *.xcdatamodeld file (without the file extension)

    +
    +
    + + modelVersionFileURL + + +
    +

    the file URL that points to the .xcdatamodeld’s momd file.

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + modelVersion + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public var modelVersion: ModelVersion { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + rawModel() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func rawModel() -> NSManagedObjectModel
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CoreStoreObject.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CoreStoreObject.html new file mode 100644 index 0000000..70b214e --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CoreStoreObject.html @@ -0,0 +1,1283 @@ + + + + CoreStoreObject Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CoreStoreObject

+
+
+
open class CoreStoreObject : DynamicObject, Hashable
+ +
+
+

The CoreStoreObject is an abstract class for creating CoreStore-managed objects that are more type-safe and more convenient than NSManagedObject subclasses. The model entities for CoreStoreObject subclasses are inferred from the Swift declaration themselves; no .xcdatamodeld files are needed. To declare persisted attributes and relationships for the CoreStoreObject subclass, declare properties of type Value.Required<T>, Value.Optional<T> for values, or Relationship.ToOne<T>, Relationship.ToManyOrdered<T>, Relationship.ToManyUnordered<T> for relationships.

+
class Animal: CoreStoreObject {
+    let species = Value.Required<String>("species", initial: "")
+    let nickname = Value.Optional<String>("nickname")
+    let master = Relationship.ToOne<Person>("master")
+}
+
+class Person: CoreStoreObject {
+    let name = Value.Required<String>("name", initial: "")
+    let pet = Relationship.ToOne<Animal>("pet", inverse: { $0.master })
+}
+
+ +

CoreStoreObject entities for a model version should be added to CoreStoreSchema instance.

+
CoreStore.defaultStack = DataStack(
+    CoreStoreSchema(
+        modelVersion: "V1",
+        entities: [
+            Entity<Animal>("Animal"),
+            Entity<Person>("Person")
+        ]
+    )
+)
+
+
+

See also

+ CoreStoreSchema + +
+
+

See also

+ CoreStoreObject.Value + +
+
+

See also

+ CoreStoreObject.Relationship + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + init(rawObject:) + +
    +
    +
    +
    +
    +
    +

    Do not call this directly. This is exposed as public only as a required initializer.

    +
    +

    Important

    + subclasses that need a custom initializer should override both init(_:) and init(asMeta:), and to call their corresponding super implementations. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init(rawObject: NSManagedObject)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(asMeta:) + +
    +
    +
    +
    +
    +
    +

    Do not call this directly. This is exposed as public only as a required initializer.

    +
    +

    Important

    + subclasses that need a custom initializer should override both init(_:) and init(asMeta:), and to call their corresponding super implementations. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init(asMeta: Void)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: CoreStoreObject, rhs: CoreStoreObject) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + fetchSource() + +
    +
    +
    +
    +
    +
    +

    Exposes a FetchableSource that can fetch sibling objects of this CoreStoreObject instance. This may be the DataStack, a BaseDataTransaction, the NSManagedObjectContext itself, or nil if the obejct’s parent is already deallocated.

    +
    +

    Warning

    + Future implementations may change the instance returned by this method depending on the timing or condition that fetchSource() was called. Do not make assumptions that the instance will be a specific instance. If the NSManagedObjectContext instance is desired, use the FetchableSource.unsafeContext() method to get the correct instance. Also, do not assume that the fetchSource() and querySource() return the same instance all the time. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchSource() -> FetchableSource?
    + +
    +
    +
    +

    Return Value

    +

    a FetchableSource that can fetch sibling objects of this CoreStoreObject instance. This may be the DataStack, a BaseDataTransaction, the NSManagedObjectContext itself, or nil if the object’s parent is already deallocated.

    +
    +
    +
    +
  • +
  • +
    + + + + querySource() + +
    +
    +
    +
    +
    +
    +

    Exposes a QueryableSource that can query attributes and aggregate values. This may be the DataStack, a BaseDataTransaction, the NSManagedObjectContext itself, or nil if the obejct’s parent is already deallocated.

    +
    +

    Warning

    + Future implementations may change the instance returned by this method depending on the timing or condition that querySource() was called. Do not make assumptions that the instance will be a specific instance. If the NSManagedObjectContext instance is desired, use the QueryableSource.unsafeContext() method to get the correct instance. Also, do not assume that the fetchSource() and querySource() return the same instance all the time. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func querySource() -> QueryableSource?
    + +
    +
    +
    +

    Return Value

    +

    a QueryableSource that can query attributes and aggregate values. This may be the DataStack, a BaseDataTransaction, the NSManagedObjectContext itself, or nil if the object’s parent is already deallocated.

    +
    +
    +
    +
  • +
  • +
    + + + + refreshAsFault() + +
    +
    +
    +
    +
    +
    +

    Re-faults the object to use the latest values from the persistent store

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func refreshAsFault()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + refreshAndMerge() + +
    +
    +
    +
    +
    +
    +

    Re-faults the object to use the latest values from the persistent store and merges previously pending changes back

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func refreshAndMerge()
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class func cs_forceCreate(entityDescription: NSEntityDescription, into context: NSManagedObjectContext, assignTo store: NSPersistentStore) -> Self
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_fromRaw(object:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class func cs_fromRaw(object: NSManagedObject) -> Self
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_matches(object:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func cs_matches(object: NSManagedObject) -> Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_id() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cs_id() -> NSManagedObjectID
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_toRaw() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cs_toRaw() -> NSManagedObject
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CoreStoreObjectObjectDiff.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CoreStoreObjectObjectDiff.html new file mode 100644 index 0000000..31053d9 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CoreStoreObjectObjectDiff.html @@ -0,0 +1,896 @@ + + + + CoreStoreObjectObjectDiff Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CoreStoreObjectObjectDiff

+
+
+
public final class CoreStoreObjectObjectDiff<D> where D : CoreStoreObject
+ +
+
+

The object containing the changeset for an observed RelationshipContainer.ToOne property.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + kind + +
    +
    +
    +
    +
    +
    +

    Indicates the kind of change. See the comments for NSObject.observeValue(forKeyPath:of:change:context:) for more information.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let kind: NSKeyValueChange
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + newValue + +
    +
    +
    +
    +
    +
    +

    newValue and oldValue will only be non-nil if .new/.old is passed to observe(). In general, get the most up to date value by accessing it directly on the observed object instead.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) lazy var newValue: D? { get set }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + oldValue + +
    +
    +
    +
    +
    +
    +

    newValue and oldValue will only be non-nil if .new/.old is passed to observe(). In general, get the most up to date value by accessing it directly on the observed object instead.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) lazy var oldValue: D? { get set }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + isPrior + +
    +
    +
    +
    +
    +
    +

    ‘isPrior’ will be true if this change observation is being sent before the change happens, due to .prior being passed to observe()

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let isPrior: Bool
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CoreStoreObjectOrderedDiff.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CoreStoreObjectOrderedDiff.html new file mode 100644 index 0000000..1fedec2 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CoreStoreObjectOrderedDiff.html @@ -0,0 +1,923 @@ + + + + CoreStoreObjectOrderedDiff Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CoreStoreObjectOrderedDiff

+
+
+
public final class CoreStoreObjectOrderedDiff<D> where D : CoreStoreObject
+ +
+
+

The object containing the changeset for an observed RelationshipContainer.Ordered property.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + kind + +
    +
    +
    +
    +
    +
    +

    Indicates the kind of change. See the comments for NSObject.observeValue(forKeyPath:of:change:context:) for more information.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let kind: NSKeyValueChange
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + newValue + +
    +
    +
    +
    +
    +
    +

    newValue and oldValue will only be non-nil if .new/.old is passed to observe(). In general, get the most up to date value by accessing it directly on the observed object instead.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) lazy var newValue: [D] { get set }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + oldValue + +
    +
    +
    +
    +
    +
    +

    newValue and oldValue will only be non-nil if .new/.old is passed to observe(). In general, get the most up to date value by accessing it directly on the observed object instead.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) lazy var oldValue: [D] { get set }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + indexes + +
    +
    +
    +
    +
    +
    +

    indexes will be nil unless the observed KeyPath refers to an ordered to-many property

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let indexes: IndexSet
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + isPrior + +
    +
    +
    +
    +
    +
    +

    ‘isPrior’ will be true if this change observation is being sent before the change happens, due to .prior being passed to observe()

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let isPrior: Bool
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CoreStoreObjectTransformableDiff.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CoreStoreObjectTransformableDiff.html new file mode 100644 index 0000000..7a79fa2 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CoreStoreObjectTransformableDiff.html @@ -0,0 +1,896 @@ + + + + CoreStoreObjectTransformableDiff Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CoreStoreObjectTransformableDiff

+
+
+
public final class CoreStoreObjectTransformableDiff<V> where V : NSCoding, V : NSCopying
+ +
+
+

The object containing the changeset for an observed TransformableContainer.Required or TransformableContainer.Optional property.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + kind + +
    +
    +
    +
    +
    +
    +

    Indicates the kind of change. See the comments for NSObject.observeValue(forKeyPath:of:change:context:) for more information.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let kind: NSKeyValueChange
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + newValue + +
    +
    +
    +
    +
    +
    +

    newValue and oldValue will only be non-nil if .new/.old is passed to observe(). In general, get the most up to date value by accessing it directly on the observed object instead.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let newValue: V?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + oldValue + +
    +
    +
    +
    +
    +
    +

    newValue and oldValue will only be non-nil if .new/.old is passed to observe(). In general, get the most up to date value by accessing it directly on the observed object instead.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let oldValue: V?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + isPrior + +
    +
    +
    +
    +
    +
    +

    ‘isPrior’ will be true if this change observation is being sent before the change happens, due to .prior being passed to observe()

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let isPrior: Bool
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CoreStoreObjectUnorderedDiff.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CoreStoreObjectUnorderedDiff.html new file mode 100644 index 0000000..0f537b9 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CoreStoreObjectUnorderedDiff.html @@ -0,0 +1,896 @@ + + + + CoreStoreObjectUnorderedDiff Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CoreStoreObjectUnorderedDiff

+
+
+
public final class CoreStoreObjectUnorderedDiff<D> where D : CoreStoreObject
+ +
+
+

The object containing the changeset for an observed RelationshipContainer.ToManyUnordered property.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + kind + +
    +
    +
    +
    +
    +
    +

    Indicates the kind of change. See the comments for NSObject.observeValue(forKeyPath:of:change:context:) for more information.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let kind: NSKeyValueChange
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + newValue + +
    +
    +
    +
    +
    +
    +

    newValue and oldValue will only be non-nil if .new/.old is passed to observe(). In general, get the most up to date value by accessing it directly on the observed object instead.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) lazy var newValue: Set<D> { get set }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + oldValue + +
    +
    +
    +
    +
    +
    +

    newValue and oldValue will only be non-nil if .new/.old is passed to observe(). In general, get the most up to date value by accessing it directly on the observed object instead.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) lazy var oldValue: Set<D> { get set }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + isPrior + +
    +
    +
    +
    +
    +
    +

    ‘isPrior’ will be true if this change observation is being sent before the change happens, due to .prior being passed to observe()

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let isPrior: Bool
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CoreStoreObjectValueDiff.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CoreStoreObjectValueDiff.html new file mode 100644 index 0000000..1a0a0b7 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CoreStoreObjectValueDiff.html @@ -0,0 +1,896 @@ + + + + CoreStoreObjectValueDiff Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CoreStoreObjectValueDiff

+
+
+
public final class CoreStoreObjectValueDiff<V> where V : ImportableAttributeType
+ +
+
+

The object containing the changeset for an observed ValueContainer.Required and ValueContainer.Optional property.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + kind + +
    +
    +
    +
    +
    +
    +

    Indicates the kind of change. See the comments for NSObject.observeValue(forKeyPath:of:change:context:) for more information.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let kind: NSKeyValueChange
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + newValue + +
    +
    +
    +
    +
    +
    +

    newValue and oldValue will only be non-nil if .new/.old is passed to observe(). newValue will be nil if isPrior is true.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) lazy var newValue: V? { get set }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + oldValue + +
    +
    +
    +
    +
    +
    +

    newValue and oldValue will only be non-nil if .new/.old is passed to observe().

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) lazy var oldValue: V? { get set }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + isPrior + +
    +
    +
    +
    +
    +
    +

    ‘isPrior’ will be true if this change observation is being sent before the change happens, due to .prior being passed to observe()

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let isPrior: Bool
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CoreStoreSchema.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CoreStoreSchema.html new file mode 100644 index 0000000..a16f7d0 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CoreStoreSchema.html @@ -0,0 +1,1111 @@ + + + + CoreStoreSchema Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CoreStoreSchema

+
+
+
public final class CoreStoreSchema : DynamicSchema
+ +
+
+

The CoreStoreSchema describes models written for CoreStoreObject Swift class declarations for a particular model version. CoreStoreObject entities for a model version should be added to CoreStoreSchema instance.

+
class Animal: CoreStoreObject {
+    let species = Value.Required<String>("species", initial: "")
+    let nickname = Value.Optional<String>("nickname")
+    let master = Relationship.ToOne<Person>("master")
+}
+
+class Person: CoreStoreObject {
+    let name = Value.Required<String>("name", initial: "")
+    let pet = Relationship.ToOne<Animal>("pet", inverse: { $0.master })
+}
+
+CoreStore.defaultStack = DataStack(
+    CoreStoreSchema(
+        modelVersion: "V1",
+        entities: [
+            Entity<Animal>("Animal"),
+            Entity<Person>("Person")
+        ],
+        versionLock: [
+            "Animal": [0x2698c812ebbc3b97, 0x751e3fa3f04cf9, 0x51fd460d3babc82, 0x92b4ba735b5a3053],
+            "Person": [0xae4060a59f990ef0, 0x8ac83a6e1411c130, 0xa29fea58e2e38ab6, 0x2071bb7e33d77887]
+        ]
+    )
+)
+
+
+

See also

+ CoreStoreObject + +
+
+

See also

+ Entity + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes a CoreStoreSchema. Using this initializer only if the entities don’t need to be assigned to particular Configurations. To use multiple configurations (for example, to separate entities in different StorageInterfaces), use the init(modelVersion:entitiesByConfiguration:versionLock:) initializer.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let nickname = Value.Optional<String>("nickname")
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +
    +class Person: CoreStoreObject {
    +    let name = Value.Required<String>("name", initial: "")
    +    let pet = Relationship.ToOne<Animal>("pet", inverse: { $0.master })
    +}
    +
    +CoreStore.defaultStack = DataStack(
    +    CoreStoreSchema(
    +        modelVersion: "V1",
    +        entities: [
    +            Entity<Animal>("Animal"),
    +            Entity<Person>("Person")
    +        ],
    +        versionLock: [
    +            "Animal": [0x2698c812ebbc3b97, 0x751e3fa3f04cf9, 0x51fd460d3babc82, 0x92b4ba735b5a3053],
    +            "Person": [0xae4060a59f990ef0, 0x8ac83a6e1411c130, 0xa29fea58e2e38ab6, 0x2071bb7e33d77887]
    +        ]
    +    )
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(modelVersion: ModelVersion, entities: [DynamicEntity], versionLock: VersionLock? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + modelVersion + + +
    +

    the model version for the schema. This string should be unique from other DynamicSchema‘s model versions.

    +
    +
    + + entities + + +
    +

    an array of Entity<T> pertaining to all CoreStoreObject subclasses to be added to the schema version.

    +
    +
    + + versionLock + + +
    +

    an optional list of VersionLock hashes for each entity name in the entities array. If any DynamicEntity doesn’t match its version lock hash, an assertion will be raised.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a CoreStoreSchema. Using this initializer if multiple Configurations (for example, to separate entities in different StorageInterfaces) are needed. To add an entity only to the default configuration, assign an empty set to its configurations list. Note that regardless of the set configurations, all entities will be added to the default configuration.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let nickname = Value.Optional<String>("nickname")
    +}
    +
    +class Person: CoreStoreObject {
    +    let name = Value.Required<String>("name", initial: "")
    +}
    +
    +CoreStore.defaultStack = DataStack(
    +    CoreStoreSchema(
    +        modelVersion: "V1",
    +        entityConfigurations: [
    +            Entity<Animal>("Animal"): [],
    +            Entity<Person>("Person"): ["People"]
    +        ],
    +        versionLock: [
    +            "Animal": [0x2698c812ebbc3b97, 0x751e3fa3f04cf9, 0x51fd460d3babc82, 0x92b4ba735b5a3053],
    +            "Person": [0xae4060a59f990ef0, 0x8ac83a6e1411c130, 0xa29fea58e2e38ab6, 0x2071bb7e33d77887]
    +        ]
    +    )
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init(modelVersion: ModelVersion, entityConfigurations: [DynamicEntity: Set<String>], versionLock: VersionLock? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + modelVersion + + +
    +

    the model version for the schema. This string should be unique from other DynamicSchema‘s model versions.

    +
    +
    + + entityConfigurations + + +
    +

    a dictionary with Entity<T> pertaining to all CoreStoreObject subclasses and the corresponding list of Configurations they should be added to. To add an entity only to the default configuration, assign an empty set to its configurations list. Note that regardless of the set configurations, all entities will be added to the default configuration.

    +
    +
    + + versionLock + + +
    +

    an optional list of VersionLock hashes for each entity name in the entities array. If any DynamicEntity doesn’t match its version lock hash, an assertion will be raised.

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + modelVersion + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let modelVersion: ModelVersion
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + rawModel() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func rawModel() -> NSManagedObjectModel
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CustomSchemaMappingProvider.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CustomSchemaMappingProvider.html new file mode 100644 index 0000000..d88208b --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CustomSchemaMappingProvider.html @@ -0,0 +1,1140 @@ + + + + CustomSchemaMappingProvider Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CustomSchemaMappingProvider

+
+
+
public class CustomSchemaMappingProvider : Hashable, SchemaMappingProvider
+ +
+
+

A SchemaMappingProvider that accepts custom mappings for some entities. Mappings of entities with no CustomMapping provided will be automatically calculated if possible.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + sourceVersion + +
    +
    +
    +
    +
    +
    +

    The source model version for the mapping.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let sourceVersion: ModelVersion
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + destinationVersion + +
    +
    +
    +
    +
    +
    +

    The destination model version for the mapping.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let destinationVersion: ModelVersion
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a CustomSchemaMappingProvider

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init(from sourceVersion: ModelVersion, to destinationVersion: ModelVersion, entityMappings: Set<CustomMapping> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + sourceVersion + + +
    +

    the source model version for the mapping

    +
    +
    + + destinationVersion + + +
    +

    the destination model version for the mapping

    +
    +
    + + entityMappings + + +
    +

    a list of CustomMappings. Mappings of entities with no CustomMapping provided will be automatically calculated if possible. Any conflicts or ambiguity will raise an assertion.

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CustomMapping + +
    +
    +
    +
    +
    +
    +

    Provides the type of mapping for an entity. Mappings of entities with no CustomMapping provided will be automatically calculated if possible. Any conflicts or ambiguity will raise an assertion.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum CustomMapping : Hashable
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + UnsafeSourceObject + +
    +
    +
    +
    +
    +
    +

    The read-only proxy object used for the source object in a mapping’s Transformer closure. Properties can be accessed either by keyPath string or by NSAttributeDescription.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class UnsafeSourceObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    The read-write proxy object used for the destination object that can be created in a mapping’s Transformer closure. Properties can be accessed and mutated either through keyPath string or by NSAttributeDescription.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class UnsafeDestinationObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: CustomSchemaMappingProvider, rhs: CustomSchemaMappingProvider) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CustomSchemaMappingProvider/CustomMapping.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CustomSchemaMappingProvider/CustomMapping.html new file mode 100644 index 0000000..324b775 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CustomSchemaMappingProvider/CustomMapping.html @@ -0,0 +1,1055 @@ + + + + CustomMapping Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CustomMapping

+
+
+
public enum CustomMapping : Hashable
+ +
+
+

Provides the type of mapping for an entity. Mappings of entities with no CustomMapping provided will be automatically calculated if possible. Any conflicts or ambiguity will raise an assertion.

+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    The sourceEntity is meant to be removed from the source DynamicSchema and should not be migrated to the destination DynamicSchema.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case deleteEntity(sourceEntity: EntityName)
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The destinationEntity is newly added to the destination DynamicSchema and has no mapping from the source DynamicSchema.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case insertEntity(destinationEntity: EntityName)
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The DynamicSchemas entity has no changes and can be copied directly from sourceEntity to destinationEntity.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case copyEntity(sourceEntity: EntityName, destinationEntity: EntityName)
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The DynamicSchemas entity needs transformations from sourceEntity to destinationEntity. The transformer closure will be used to apply the changes. The CustomMapping.inferredTransformation method can be used directly as the transformer if the changes can be inferred (i.e. lightweight).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case transformEntity(sourceEntity: EntityName, destinationEntity: EntityName, transformer: Transformer)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + Transformer + +
    +
    +
    +
    +
    +
    +

    The closure type for CustomMapping.transformEntity.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Transformer = (_ sourceObject: UnsafeSourceObject, _ createDestinationObject: () -> UnsafeDestinationObject) throws -> Void
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sourceObject + + +
    +

    a proxy object representing the source entity. The properties can be accessed via keyPath.

    +
    +
    + + createDestinationObject + + +
    +

    the closure to create the object for the destination entity. The CustomMapping.inferredTransformation method can be used directly as the transformer if the changes can be inferred (i.e. lightweight). The object is created lazily and executing the closure multiple times will return the same instance. The destination object’s properties can be accessed and updated via keyPath.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The CustomMapping.inferredTransformation method can be used directly as the transformer if the changes can be inferred (i.e. lightweight).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func inferredTransformation(_ sourceObject: UnsafeSourceObject, _ createDestinationObject: () -> UnsafeDestinationObject) throws
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: CustomMapping, rhs: CustomMapping) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CustomSchemaMappingProvider/UnsafeDestinationObject.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CustomSchemaMappingProvider/UnsafeDestinationObject.html new file mode 100644 index 0000000..2799dbf --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CustomSchemaMappingProvider/UnsafeDestinationObject.html @@ -0,0 +1,869 @@ + + + + UnsafeDestinationObject Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

UnsafeDestinationObject

+
+
+
public final class UnsafeDestinationObject
+ +
+
+

The read-write proxy object used for the destination object that can be created in a mapping’s Transformer closure. Properties can be accessed and mutated either through keyPath string or by NSAttributeDescription.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Accesses or mutates the property value via its keyPath.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(attribute: KeyPathString) -> Any? { get set }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Accesses or mutates the property value via its NSAttributeDescription, which can be accessed from the enumerateAttributes(_:) method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(attribute: NSAttributeDescription) -> Any? { get set }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Enumerates the all NSAttributeDescriptions. The attribute argument can be used as the subscript key to access and mutate the property. The sourceAttribute can be used to access properties from the source UnsafeSourceObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func enumerateAttributes(_ closure: (_ attribute: NSAttributeDescription, _ sourceAttribute: NSAttributeDescription?) -> Void)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CustomSchemaMappingProvider/UnsafeSourceObject.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CustomSchemaMappingProvider/UnsafeSourceObject.html new file mode 100644 index 0000000..3a1c218 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/CustomSchemaMappingProvider/UnsafeSourceObject.html @@ -0,0 +1,869 @@ + + + + UnsafeSourceObject Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

UnsafeSourceObject

+
+
+
public final class UnsafeSourceObject
+ +
+
+

The read-only proxy object used for the source object in a mapping’s Transformer closure. Properties can be accessed either by keyPath string or by NSAttributeDescription.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Accesses the property value via its keyPath.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(attribute: KeyPathString) -> Any? { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Accesses the property value via its NSAttributeDescription, which can be accessed from the enumerateAttributes(_:) method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(attribute: NSAttributeDescription) -> Any? { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Enumerates the all NSAttributeDescriptions. The attribute argument can be used as the subscript key to access the property.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func enumerateAttributes(_ closure: (_ attribute: NSAttributeDescription) -> Void)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/DataStack.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/DataStack.html new file mode 100644 index 0000000..abccbb9 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/DataStack.html @@ -0,0 +1,4996 @@ + + + + DataStack Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

DataStack

+
+
+
public final class DataStack : Equatable
+ +
+
+

The DataStack encapsulates the data model for the Core Data stack. Each DataStack can have multiple data stores, usually specified as a Configuration in the model editor. Behind the scenes, the DataStack manages its own NSPersistentStoreCoordinator, a root NSManagedObjectContext for disk saves, and a shared NSManagedObjectContext designed as a read-only model interface for NSManagedObjects.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + applicationName + +
    +
    +
    +
    +
    +
    +

    The resolved application name, used by the DataStack as the default Xcode model name (.xcdatamodel filename) if not explicitly provided.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let applicationName: String
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Convenience initializer for DataStack that creates a SchemaHistory from the model with the specified modelName in the specified bundle.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(xcodeModelName: XcodeDataModelFileName = DataStack.applicationName, bundle: Bundle = Bundle.main, migrationChain: MigrationChain = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + xcodeModelName + + +
    +

    the name of the (.xcdatamodeld) model file. If not specified, the application name (CFBundleName) will be used if it exists, or CoreData if it the bundle name was not set (e.g. in Unit Tests).

    +
    +
    + + bundle + + +
    +

    an optional bundle to load models from. If not specified, the main bundle will be used.

    +
    +
    + + migrationChain + + +
    +

    the MigrationChain that indicates the sequence of model versions to be used as the order for progressive migrations. If not specified, will default to a non-migrating data stack.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Convenience initializer for DataStack that creates a SchemaHistory from a list of DynamicSchema versions.

    +
    CoreStore.defaultStack = DataStack(
    +    XcodeDataModelSchema(modelName: "MyModelV1"),
    +    CoreStoreSchema(
    +        modelVersion: "MyModelV2",
    +        entities: [
    +            Entity<Animal>("Animal"),
    +            Entity<Person>("Person")
    +        ]
    +    ),
    +    migrationChain: ["MyModelV1", "MyModelV2"]
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(_ schema: DynamicSchema, _ otherSchema: DynamicSchema..., migrationChain: MigrationChain = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + schema + + +
    +

    an instance of DynamicSchema

    +
    +
    + + otherSchema + + +
    +

    a list of other DynamicSchema instances that represent present/previous/future model versions, in any order

    +
    +
    + + migrationChain + + +
    +

    the MigrationChain that indicates the sequence of model versions to be used as the order for progressive migrations. If not specified, will default to a non-migrating data stack.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(schemaHistory:) + +
    +
    +
    +
    +
    +
    +

    Initializes a DataStack from a SchemaHistory instance.

    +
    CoreStore.defaultStack = DataStack(
    +    schemaHistory: SchemaHistory(
    +        XcodeDataModelSchema(modelName: "MyModelV1"),
    +        CoreStoreSchema(
    +            modelVersion: "MyModelV2",
    +            entities: [
    +                Entity<Animal>("Animal"),
    +                Entity<Person>("Person")
    +            ]
    +        ),
    +        migrationChain: ["MyModelV1", "MyModelV2"]
    +    )
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init(schemaHistory: SchemaHistory)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + schemaHistory + + +
    +

    the SchemaHistory for the stack

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + modelVersion + +
    +
    +
    +
    +
    +
    +

    Returns the DataStack‘s current model version. StorageInterfaces added to the stack will be migrated to this version.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var modelVersion: String { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + modelSchema + +
    +
    +
    +
    +
    +
    +

    Returns the DataStack‘s current model schema. StorageInterfaces added to the stack will be migrated to this version.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var modelSchema: DynamicSchema { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the entity name-to-class type mapping from the DataStack‘s model.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func entityTypesByName(for type: NSManagedObject.Type) -> [EntityName : NSManagedObject.Type]
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the entity name-to-class type mapping from the DataStack‘s model.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func entityTypesByName(for type: CoreStoreObject.Type) -> [EntityName : CoreStoreObject.Type]
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the NSEntityDescription for the specified NSManagedObject subclass.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func entityDescription(for type: NSManagedObject.Type) -> NSEntityDescription?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the NSEntityDescription for the specified CoreStoreObject subclass.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func entityDescription(for type: CoreStoreObject.Type) -> NSEntityDescription?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the NSManagedObjectID for the specified object URI if it exists in the persistent store.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func objectID(forURIRepresentation url: URL) -> NSManagedObjectID?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + addStorageAndWait() + +
    +
    +
    +
    +
    +
    +

    Creates an SQLiteStore with default parameters and adds it to the stack. This method blocks until completion.

    +
    try dataStack.addStorageAndWait()
    +
    +
    +

    Throws

    + a CoreStoreError value indicating the failure + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func addStorageAndWait() throws -> SQLiteStore
    + +
    +
    +
    +

    Return Value

    +

    the local SQLite storage added to the stack

    +
    +
    +
    +
  • +
  • +
    + + + + addStorageAndWait(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a StorageInterface to the stack and blocks until completion.

    +
    try dataStack.addStorageAndWait(InMemoryStore(configuration: "Config1"))
    +
    +
    +

    Throws

    + a CoreStoreError value indicating the failure + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func addStorageAndWait<T>(_ storage: T) throws -> T where T : StorageInterface
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + storage + + + +
    +
    +
    +

    Return Value

    +

    the StorageInterface added to the stack

    +
    +
    +
    +
  • +
  • +
    + + + + addStorageAndWait(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a LocalStorage to the stack and blocks until completion.

    +
    try dataStack.addStorageAndWait(SQLiteStore(configuration: "Config1"))
    +
    +
    +

    Throws

    + a CoreStoreError value indicating the failure + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func addStorageAndWait<T>(_ storage: T) throws -> T where T : LocalStorage
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + storage + + +
    +

    the local storage

    +
    +
    +
    +
    +

    Return Value

    +

    the local storage added to the stack. Note that this may not always be the same instance as the parameter argument if a previous LocalStorage was already added at the same URL and with the same configuration.

    +
    +
    +
    +
  • +
  • +
    + + + + addStorageAndWait(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a CloudStorage to the stack and blocks until completion.

    +
    guard let storage = ICloudStore(
    +    ubiquitousContentName: "MyAppCloudData",
    +    ubiquitousContentTransactionLogsSubdirectory: "logs/config1",
    +    ubiquitousContainerID: "iCloud.com.mycompany.myapp.containername",
    +    ubiquitousPeerToken: "9614d658014f4151a95d8048fb717cf0",
    +    configuration: "Config1",
    +    cloudStorageOptions: .recreateLocalStoreOnModelMismatch
    +) else {
    +    // iCloud is not available on the device
    +    return
    +}
    +try dataStack.addStorageAndWait(storage)
    +
    +
    +

    Throws

    + a CoreStoreError value indicating the failure + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func addStorageAndWait<T>(_ storage: T) throws -> T where T : CloudStorage
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + storage + + +
    +

    the local storage

    +
    +
    +
    +
    +

    Return Value

    +

    the cloud storage added to the stack. Note that this may not always be the same instance as the parameter argument if a previous CloudStorage was already added at the same URL and with the same configuration.

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + userInfo + +
    +
    +
    +
    +
    +
    +

    Allow external libraries to store custom data in the DataStack. App code should rarely have a need for this.

    +
    enum Static {
    +   static var myDataKey: Void?
    +}
    +CoreStore.defaultStack.userInfo[&Static.myDataKey] = myObject
    +
    +
    +

    Important

    + Do not use this method to store thread-sensitive data. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let userInfo: UserInfo
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: DataStack, rhs: DataStack) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Asynchronously adds a StorageInterface to the stack. Migrations are also initiated by default.

    +
    dataStack.addStorage(
    +    InMemoryStore(configuration: "Config1"),
    +    completion: { result in
    +        switch result {
    +        case .success(let storage): // ...
    +        case .failure(let error): // ...
    +        }
    +    }
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func addStorage<T>(_ storage: T, completion: @escaping (SetupResult<T>) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the storage

    +
    +
    + + completion + + +
    +

    the closure to be executed on the main queue when the process completes, either due to success or failure. The closure’s SetupResult argument indicates the result. Note that the StorageInterface associated to the SetupResult.success may not always be the same instance as the parameter argument if a previous StorageInterface was already added at the same URL and with the same configuration.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously adds a LocalStorage to the stack. Migrations are also initiated by default.

    +
    let migrationProgress = dataStack.addStorage(
    +    SQLiteStore(fileName: "core_data.sqlite", configuration: "Config1"),
    +    completion: { result in
    +        switch result {
    +        case .success(let storage): // ...
    +        case .failure(let error): // ...
    +        }
    +    }
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func addStorage<T: LocalStorage>(_ storage: T, completion: @escaping (SetupResult<T>) -> Void) -> Progress?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the local storage

    +
    +
    + + completion + + +
    +

    the closure to be executed on the main queue when the process completes, either due to success or failure. The closure’s SetupResult argument indicates the result. Note that the LocalStorage associated to the SetupResult.success may not always be the same instance as the parameter argument if a previous LocalStorage was already added at the same URL and with the same configuration.

    +
    +
    +
    +
    +

    Return Value

    +

    a Progress instance if a migration has started, or nil if either no migrations are required or if a failure occured.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously adds a CloudStorage to the stack. Migrations are also initiated by default.

    +
    guard let storage = ICloudStore(
    +    ubiquitousContentName: "MyAppCloudData",
    +    ubiquitousContentTransactionLogsSubdirectory: "logs/config1",
    +    ubiquitousContainerID: "iCloud.com.mycompany.myapp.containername",
    +    ubiquitousPeerToken: "9614d658014f4151a95d8048fb717cf0",
    +    configuration: "Config1",
    +    cloudStorageOptions: .recreateLocalStoreOnModelMismatch
    +) else {
    +    // iCloud is not available on the device
    +    return
    +}
    +dataStack.addStorage(
    +    storage,
    +    completion: { result in
    +        switch result {
    +        case .success(let storage): // ...
    +        case .failure(let error): // ...
    +        }
    +    }
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func addStorage<T: CloudStorage>(_ storage: T, completion: @escaping (SetupResult<T>) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the cloud storage

    +
    +
    + + completion + + +
    +

    the closure to be executed on the main queue when the process completes, either due to success or failure. The closure’s SetupResult argument indicates the result. Note that the CloudStorage associated to the SetupResult.success may not always be the same instance as the parameter argument if a previous CloudStorage was already added at the same URL and with the same configuration.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Migrates a local storage to match the DataStack‘s managed object model version. This method does NOT add the migrated store to the data stack.

    +
    +

    Throws

    + a CoreStoreError value indicating the failure + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func upgradeStorageIfNeeded<T: LocalStorage>(_ storage: T, completion: @escaping (MigrationResult) -> Void) throws -> Progress?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the local storage

    +
    +
    + + completion + + +
    +

    the closure to be executed on the main queue when the migration completes, either due to success or failure. The closure’s MigrationResult argument indicates the result.

    +
    +
    +
    +
    +

    Return Value

    +

    a Progress instance if a migration has started, or nil is no migrations are required

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Checks the migration steps required for the storage to match the DataStack‘s managed object model version.

    +
    +

    Throws

    + a CoreStoreError value indicating the failure + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func requiredMigrationsForStorage<T>(_ storage: T) throws -> [MigrationType] where T : LocalStorage
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + storage + + +
    +

    the local storage

    +
    +
    +
    +
    +

    Return Value

    +

    a MigrationType array indicating the migration steps required for the store, or an empty array if the file does not exist yet. Otherwise, an error is thrown if either inspection of the store failed, or if no mapping model was found/inferred.

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + monitorObject(_:) + +
    +
    +
    +
    +
    +
    +

    Creates an ObjectMonitor for the specified DynamicObject. Multiple ObjectObservers may then register themselves to be notified when changes are made to the DynamicObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorObject<D>(_ object: D) -> ObjectMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the DynamicObject to observe changes from

    +
    +
    +
    +
    +

    Return Value

    +

    a ObjectMonitor that monitors changes to object

    +
    +
    +
    +
  • +
  • +
    + + + + monitorList(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ListMonitor for a list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorList<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> ListMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • +
    + + + + monitorList(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ListMonitor for a list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorList<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> ListMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • +
    + + + + monitorList(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ListMonitor for a list of DynamicObjects that satisfy the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let monitor = dataStack.monitorList(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorList<B>(_ clauseChain: B) -> ListMonitor<B.ObjectType> where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor for a list of DynamicObjects that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a ListMonitor for a list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorList<D>(createAsynchronously: @escaping (ListMonitor<D>) -> Void, _ from: From<D>, _ fetchClauses: FetchClause...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a ListMonitor for a list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorList<D>(createAsynchronously: @escaping (ListMonitor<D>) -> Void, _ from: From<D>, _ fetchClauses: [FetchClause])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a ListMonitor for a list of DynamicObjects that satisfy the specified FetchChainableBuilderType built from a chain of clauses. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    +
    dataStack.monitorList(
    +    { (monitor) in
    +        self.monitor = monitor
    +    },
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorList<B: FetchChainableBuilderType>(createAsynchronously: @escaping (ListMonitor<B.ObjectType>) -> Void, _ clauseChain: B)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor for a list of DynamicObjects that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorSectionedList<D>(_ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: FetchClause...) -> ListMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorSectionedList<D>(_ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: [FetchClause]) -> ListMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified SectionMonitorBuilderType built from a chain of clauses.

    +
    let monitor = dataStack.monitorSectionedList(
    +    From<MyPersonEntity>()
    +        .sectionBy(\.age, { "\($0!) years old" })
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorSectionedList<B>(_ clauseChain: B) -> ListMonitor<B.ObjectType> where B : SectionMonitorBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a SectionMonitorBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor for a list of DynamicObjects that satisfy the specified SectionMonitorBuilderType

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorSectionedList<D>(createAsynchronously: @escaping (ListMonitor<D>) -> Void, _ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: FetchClause...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorSectionedList<D>(createAsynchronously: @escaping (ListMonitor<D>) -> Void, _ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: [FetchClause])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified SectionMonitorBuilderType built from a chain of clauses.

    +
    dataStack.monitorSectionedList(
    +    { (monitor) in
    +        self.monitor = monitor
    +    },
    +    From<MyPersonEntity>()
    +        .sectionBy(\.age, { "\($0!) years old" })
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorSectionedList<B: SectionMonitorBuilderType>(createAsynchronously: @escaping (ListMonitor<B.ObjectType>) -> Void, _ clauseChain: B)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a SectionMonitorBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor for a list of DynamicObjects that satisfy the specified SectionMonitorBuilderType

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the DynamicObject instance in the DataStack‘s context from a reference created from a transaction or from a different managed object context.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchExisting<D>(_ object: D) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    a reference to the object created/fetched outside the DataStack

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject instance if the object exists in the DataStack, or nil if not found.

    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the DynamicObject instance in the DataStack‘s context from an NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchExisting<D>(_ objectID: NSManagedObjectID) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objectID + + +
    +

    the NSManagedObjectID for the object

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject instance if the object exists in the DataStack, or nil if not found.

    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the DynamicObject instances in the DataStack‘s context from references created from a transaction or from a different managed object context.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchExisting<D, S>(_ objects: S) -> [D] where D : DynamicObject, D == S.Element, S : Sequence
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objects + + +
    +

    an array of DynamicObjects created/fetched outside the DataStack

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject array for objects that exists in the DataStack

    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the DynamicObject instances in the DataStack‘s context from a list of NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchExisting<D, S>(_ objectIDs: S) -> [D] where D : DynamicObject, S : Sequence, S.Element == NSManagedObjectID
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objectIDs + + +
    +

    the NSManagedObjectID array for the objects

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject array for objects that exists in the DataStack

    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the first DynamicObject instance that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchOne<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the first DynamicObject instance that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the first DynamicObject instance that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchOne<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the first DynamicObject instance that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the first DynamicObject instance that satisfies the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let youngestTeen = dataStack.fetchOne(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchOne<B>(_ clauseChain: B) -> B.ObjectType? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the first DynamicObject instance that satisfies the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches all DynamicObject instances that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchAll<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> [D]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    all DynamicObject instances that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches all DynamicObject instances that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchAll<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> [D]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    all DynamicObject instances that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches all DynamicObject instances that satisfy the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let people = dataStack.fetchAll(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchAll<B>(_ clauseChain: B) -> [B.ObjectType]? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    all DynamicObject instances that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the number of DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchCount<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> Int? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the number DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the number of DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchCount<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> Int? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the number DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the number of DynamicObjects that satisfy the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let numberOfAdults = dataStack.fetchCount(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchCount<B>(_ clauseChain: B) -> Int? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the number DynamicObjects that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> NSManagedObjectID? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> NSManagedObjectID? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let youngestTeenID = dataStack.fetchObjectID(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchObjectID<B>(_ clauseChain: B) -> NSManagedObjectID? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> [NSManagedObjectID]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> [NSManagedObjectID]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let idsOfAdults = dataStack.fetchObjectIDs(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchObjectIDs<B>(_ clauseChain: B) -> [NSManagedObjectID]? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + queryValue(_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Queries aggregate values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queryValue<D, U>(_ from: From<D>, _ selectClause: Select<D, U>, _ queryClauses: QueryClause...) -> U? where D : DynamicObject, U : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • +
    + + + + queryValue(_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Queries aggregate values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queryValue<D, U>(_ from: From<D>, _ selectClause: Select<D, U>, _ queryClauses: [QueryClause]) -> U? where D : DynamicObject, U : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • +
    + + + + queryValue(_:) + +
    +
    +
    +
    +
    +
    +

    Queries a property value or aggregate as specified by the QueryChainableBuilderType built from a chain of clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    +
    let averageAdultAge = dataStack.queryValue(
    +    From<MyPersonEntity>()
    +        .select(Int.self, .average(\.age))
    +        .where(\.age > 18)
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queryValue<B>(_ clauseChain: B) -> B.ResultType? where B : QueryChainableBuilderType, B.ResultType : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a QueryChainableBuilderType indicating the property/aggregate to fetch and the series of queries for the request.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query as specified by the QueryChainableBuilderType

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Queries a dictionary of attribute values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queryAttributes<D>(_ from: From<D>, _ selectClause: Select<D, NSDictionary>, _ queryClauses: QueryClause...) -> [[String : Any]]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Queries a dictionary of attribute values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queryAttributes<D>(_ from: From<D>, _ selectClause: Select<D, NSDictionary>, _ queryClauses: [QueryClause]) -> [[String : Any]]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • +
    + + + + queryAttributes(_:) + +
    +
    +
    +
    +
    +
    +

    Queries a dictionary of attribute values or as specified by the QueryChainableBuilderType built from a chain of clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    +
    let results = dataStack.queryAttributes(
    +    From<MyPersonEntity>()
    +        .select(
    +            NSDictionary.self,
    +            .attribute(\.age, as: "age"),
    +            .count(\.age, as: "numberOfPeople")
    +        )
    +        .groupBy(\.age)
    +)
    +for dictionary in results! {
    +    let age = dictionary["age"] as! Int
    +    let count = dictionary["numberOfPeople"] as! Int
    +    print("There are \(count) people who are \(age) years old."
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queryAttributes<B>(_ clauseChain: B) -> [[String : Any]]? where B : QueryChainableBuilderType, B.ResultType == NSDictionary
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a QueryChainableBuilderType indicating the properties to fetch and the series of queries for the request.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query as specified by the QueryChainableBuilderType

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + unsafeContext() + +
    +
    +
    +
    +
    +
    +

    The internal NSManagedObjectContext managed by this instance. Using this context directly should typically be avoided, and is provided by CoreStore only for extremely specialized cases.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func unsafeContext() -> NSManagedObjectContext
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Performs a transaction asynchronously where NSManagedObject or CoreStoreObject creates, updates, and deletes can be made. The changes are commited automatically after the task closure returns. On success, the value returned from closure will be the wrapped as .success(userInfo: T) in the completion‘s Result<T>. Any errors thrown from inside the task will be reported as .failure(error: CoreStoreError). To cancel/rollback changes, call try transaction.cancel(), which throws a CoreStoreError.userCancelled.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func perform<T>(asynchronous task: @escaping (_ transaction: AsynchronousDataTransaction) throws -> T, completion: @escaping (AsynchronousDataTransaction.Result<T>) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + task + + +
    +

    the asynchronous closure where creates, updates, and deletes can be made to the transaction. Transaction blocks are executed serially in a background queue, and all changes are made from a concurrent NSManagedObjectContext.

    +
    +
    + + completion + + +
    +

    the closure executed after the save completes. The Result argument of the closure will either wrap the return value of task, or any uncaught errors thrown from within task. Cancelled tasks will be indicated by .failure(error: CoreStoreError.userCancelled). Custom errors thrown by the user will be wrapped in CoreStoreError.userError(error: Error).

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Performs a transaction asynchronously where NSManagedObject or CoreStoreObject creates, updates, and deletes can be made. The changes are commited automatically after the task closure returns. On success, the value returned from closure will be the argument of the success closure. Any errors thrown from inside the task will be wrapped in a CoreStoreError and reported in the failure closure. To cancel/rollback changes, call try transaction.cancel(), which throws a CoreStoreError.userCancelled.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func perform<T>(asynchronous task: @escaping (_ transaction: AsynchronousDataTransaction) throws -> T, success: @escaping (T) -> Void, failure: @escaping (CoreStoreError) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + task + + +
    +

    the asynchronous closure where creates, updates, and deletes can be made to the transaction. Transaction blocks are executed serially in a background queue, and all changes are made from a concurrent NSManagedObjectContext.

    +
    +
    + + success + + +
    +

    the closure executed after the save succeeds. The T argument of the closure will be the value returned from task.

    +
    +
    + + failure + + +
    +

    the closure executed if the save fails or if any errors are thrown within task. Cancelled tasks will be indicated by CoreStoreError.userCancelled. Custom errors thrown by the user will be wrapped in CoreStoreError.userError(error: Error).

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Performs a transaction synchronously where NSManagedObject or CoreStoreObject creates, updates, and deletes can be made. The changes are commited automatically after the task closure returns. On success, the value returned from closure will be the return value of perform(synchronous:). Any errors thrown from inside the task will be thrown from perform(synchronous:). To cancel/rollback changes, call try transaction.cancel(), which throws a CoreStoreError.userCancelled.

    +
    +

    Throws

    + a CoreStoreError value indicating the failure. Cancelled tasks will be indicated by CoreStoreError.userCancelled. Custom errors thrown by the user will be wrapped in CoreStoreError.userError(error: Error). + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func perform<T>(synchronous task: ((_ transaction: SynchronousDataTransaction) throws -> T), waitForAllObservers: Bool = true) throws -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + task + + +
    +

    the synchronous non-escaping closure where creates, updates, and deletes can be made to the transaction. Transaction blocks are executed serially in a background queue, and all changes are made from a concurrent NSManagedObjectContext.

    +
    +
    + + waitForAllObservers + + +
    +

    When true, this method waits for all observers to be notified of the changes before returning. This results in more predictable data update order, but may risk triggering deadlocks. When false, this method does not wait for observers to be notified of the changes before returning. This results in lower risk for deadlocks, but the updated data may not have been propagated to the DataStack after returning. Defaults to true.

    +
    +
    +
    +
    +

    Return Value

    +

    the value returned from task

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Begins a non-contiguous transaction where NSManagedObject or CoreStoreObject creates, updates, and deletes can be made. This is useful for making temporary changes, such as partially filled forms.

    + +
      +
    • prameter supportsUndo: undo(), redo(), and rollback() methods are only available when this parameter is true, otherwise those method will raise an exception. Defaults to false. Note that turning on Undo support may heavily impact performance especially on iOS or watchOS where memory is limited.
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func beginUnsafe(supportsUndo: Bool = false) -> UnsafeDataTransaction
    + +
    +
    +
    +

    Return Value

    +

    a UnsafeDataTransaction instance where creates, updates, and deletes can be made.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Refreshes all registered objects NSManagedObjects or CoreStoreObjects in the DataStack.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func refreshAndMergeAllObjects()
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Utility for creating an NSFetchedResultsController from the DataStack. This is useful when an NSFetchedResultsController is preferred over the overhead of ListMonitors abstraction.

    +
    +

    Note

    +

    It is the caller’s responsibility to call performFetch() on the created NSFetchedResultsController.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func createFetchedResultsController<D>(_ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: FetchClause...) -> NSFetchedResultsController<D> where D : NSManagedObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    an NSFetchedResultsController that observes the DataStack

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Utility for creating an NSFetchedResultsController from a DataStack. This is useful when an NSFetchedResultsController is preferred over the overhead of ListMonitors abstraction.

    +
    +

    Note

    +

    It is the caller’s responsibility to call performFetch() on the created NSFetchedResultsController.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func createFetchedResultsController<D>(_ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: [FetchClause]) -> NSFetchedResultsController<D> where D : NSManagedObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    an NSFetchedResultsController that observes the DataStack

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Utility for creating an NSFetchedResultsController from the DataStack. This is useful when an NSFetchedResultsController is preferred over the overhead of ListMonitors abstraction.

    +
    +

    Note

    +

    It is the caller’s responsibility to call performFetch() on the created NSFetchedResultsController.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func createFetchedResultsController<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> NSFetchedResultsController<D> where D : NSManagedObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    an NSFetchedResultsController that observes the DataStack

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Utility for creating an NSFetchedResultsController from the DataStack. This is useful when an NSFetchedResultsController is preferred over the overhead of ListMonitors abstraction.

    +
    +

    Note

    +

    It is the caller’s responsibility to call performFetch() on the created NSFetchedResultsController.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func createFetchedResultsController<D>(forDataStack dataStack: DataStack, _ from: From<D>, _ fetchClauses: [FetchClause]) -> NSFetchedResultsController<D> where D : NSManagedObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    an NSFetchedResultsController that observes the DataStack

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/DefaultLogger.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/DefaultLogger.html new file mode 100644 index 0000000..ba709c2 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/DefaultLogger.html @@ -0,0 +1,1172 @@ + + + + DefaultLogger Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

DefaultLogger

+
+
+
public final class DefaultLogger : CoreStoreLogger
+ +
+
+

The DefaultLogger is a basic implementation of the CoreStoreLogger protocol.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Creates a DefaultLogger.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Handles log messages sent by the CoreStore framework.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func log(level: LogLevel, message: String, fileName: StaticString, lineNumber: Int, functionName: StaticString)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + +
    + + level + + +
    +

    the severity of the log message

    +
    +
    + + message + + +
    +

    the log message

    +
    +
    + + fileName + + +
    +

    the source file name

    +
    +
    + + lineNumber + + +
    +

    the source line number

    +
    +
    + + functionName + + +
    +

    the source function name

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Handles errors sent by the CoreStore framework.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func log(error: CoreStoreError, message: String, fileName: StaticString, lineNumber: Int, functionName: StaticString)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + +
    + + error + + +
    +

    the error

    +
    +
    + + message + + +
    +

    the error message

    +
    +
    + + fileName + + +
    +

    the source file name

    +
    +
    + + lineNumber + + +
    +

    the source line number

    +
    +
    + + functionName + + +
    +

    the source function name

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Handles assertions made throughout the CoreStore framework.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func assert(_ condition: @autoclosure () -> Bool, message: @autoclosure () -> String, fileName: StaticString, lineNumber: Int, functionName: StaticString)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + message + + +
    +

    the assertion message

    +
    +
    + + fileName + + +
    +

    the source file name

    +
    +
    + + lineNumber + + +
    +

    the source line number

    +
    +
    + + functionName + + +
    +

    the source function name

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Handles fatal errors made throughout the CoreStore framework.

    +
    +

    Important

    +

    Implementers should guarantee that this function doesn’t return, either by calling another Never function such as fatalError() or abort(), or by raising an exception.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func abort(_ message: String, fileName: StaticString, lineNumber: Int, functionName: StaticString)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + message + + +
    +

    the fatal error message

    +
    +
    + + fileName + + +
    +

    the source file name

    +
    +
    + + lineNumber + + +
    +

    the source line number

    +
    +
    + + functionName + + +
    +

    the source function name

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/DynamicEntity.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/DynamicEntity.html new file mode 100644 index 0000000..2f65abc --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/DynamicEntity.html @@ -0,0 +1,1024 @@ + + + + DynamicEntity Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

DynamicEntity

+
+
+
public class DynamicEntity : Hashable
+ +
+
+

Use concrete instances of Entity<O> in API that accept DynamicEntity arguments.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + type + +
    +
    +
    +
    +
    +
    +

    Do not use directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let type: DynamicObject.Type
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + entityName + +
    +
    +
    +
    +
    +
    +

    Do not use directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let entityName: EntityName
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + isAbstract + +
    +
    +
    +
    +
    +
    +

    Do not use directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let isAbstract: Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + versionHashModifier + +
    +
    +
    +
    +
    +
    +

    Do not use directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let versionHashModifier: String?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + indexes + +
    +
    +
    +
    +
    +
    +

    Do not use directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let indexes: [[KeyPathString]]
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + uniqueConstraints + +
    +
    +
    +
    +
    +
    +

    Do not use directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let uniqueConstraints: [[KeyPathString]]
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: DynamicEntity, rhs: DynamicEntity) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/Entity.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/Entity.html new file mode 100644 index 0000000..f1a4388 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/Entity.html @@ -0,0 +1,1060 @@ + + + + Entity Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Entity

+
+
+
public final class Entity<O> : DynamicEntity where O : CoreStoreObject
+ +
+
+

The Entity<O> contains NSEntityDescription metadata for CoreStoreObject subclasses. Pass the Entity instances to CoreStoreSchema initializer.

+
class Animal: CoreStoreObject {
+    let species = Value.Required<String>("species", initial: "")
+    let nickname = Value.Optional<String>("nickname")
+    let master = Relationship.ToOne<Person>("master")
+}
+
+class Person: CoreStoreObject {
+    let name = Value.Required<String>("name", initial: "")
+    let pet = Relationship.ToOne<Animal>("pet", inverse: { $0.master })
+}
+
+CoreStore.defaultStack = DataStack(
+    CoreStoreSchema(
+        modelVersion: "V1",
+        entities: [
+            Entity<Animal>("Animal"),
+            Entity<Person>("Person")
+        ]
+    )
+)
+
+
+

See also

+ CoreStoreSchema + +
+
+

See also

+ CoreStoreObject + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes an Entity. Always provide a concrete generic type to Entity.

    +
    Entity<Animal>("Animal")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(_ entityName: String, isAbstract: Bool = false, versionHashModifier: String? = nil, indexes: [[PartialKeyPath<O>]] = [], uniqueConstraints: [[PartialKeyPath<O>]] = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + +
    + + entityName + + +
    +

    the NSEntityDescription name to use for the entity

    +
    +
    + + isAbstract + + +
    +

    set to true if the entity is meant to be an abstract class and can only be initialized with subclass types.

    +
    +
    + + versionHashModifier + + +
    +

    the version hash modifier for the entity. Used to mark or denote an entity as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where, for example, the structure of an entity is unchanged but the format or content of data has changed.)

    +
    +
    + + indexes + + +
    +

    the compound indexes for the entity as an array of arrays. The arrays contained in the returned array contain KeyPaths to properties of the entity.

    +
    +
    + + uniqueConstraints + + +
    +

    sets uniqueness constraints for the entity. A uniqueness constraint is a set of one or more KeyPaths whose value must be unique over the set of instances of that entity. This value forms part of the entity’s version hash. Uniqueness constraint violations can be computationally expensive to handle. It is highly suggested that there be only one uniqueness constraint per entity hierarchy. Uniqueness constraints must be defined at the highest level possible, and CoreStore will raise an assertion failure if unique constraints are added to a sub entity.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes an Entity.

    +
    Entity(Animal.self, "Animal")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ type: O.Type, _ entityName: String, isAbstract: Bool = false, versionHashModifier: String? = nil, indexes: [[PartialKeyPath<O>]] = [], uniqueConstraints: [[PartialKeyPath<O>]] = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + type + + +
    +

    the DynamicObject type associated with the entity

    +
    +
    + + entityName + + +
    +

    the NSEntityDescription name to use for the entity

    +
    +
    + + isAbstract + + +
    +

    set to true if the entity is meant to be an abstract class and can only be initialized with subclass types.

    +
    +
    + + versionHashModifier + + +
    +

    the version hash modifier for the entity. Used to mark or denote an entity as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where, for example, the structure of an entity is unchanged but the format or content of data has changed.)

    +
    +
    + + indexes + + +
    +

    the compound indexes for the entity as an array of arrays. The arrays contained in the returned array contain KeyPath’s to properties of the entity.

    +
    +
    + + uniqueConstraints + + +
    +

    sets uniqueness constraints for the entity. A uniqueness constraint is a set of one or more KeyPaths whose value must be unique over the set of instances of that entity. This value forms part of the entity’s version hash. Uniqueness constraint violations can be computationally expensive to handle. It is highly suggested that there be only one uniqueness constraint per entity hierarchy. Uniqueness constraints must be defined at the highest level possible, and CoreStore will raise an assertion failure if unique constraints are added to a sub entity.

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/ICloudStore.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/ICloudStore.html new file mode 100644 index 0000000..7a209a8 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/ICloudStore.html @@ -0,0 +1,1309 @@ + + + + ICloudStore Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ICloudStore

+
+
+
@available(*, deprecated, message: "Please see the release notes and Core Data documentation.")
+public final class ICloudStore : CloudStorage
+ +
+
+

A storage interface backed by an SQLite database managed by iCloud.

+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes an iCloud store interface from the given ubiquitous store information. Returns nil if the container could not be located or if iCloud storage is unavailable for the current user or device

    +
    guard let storage = ICloudStore(
    +    ubiquitousContentName: "MyAppCloudData",
    +    ubiquitousContentTransactionLogsSubdirectory: "logs/config1",
    +    ubiquitousContainerID: "iCloud.com.mycompany.myapp.containername",
    +    ubiquitousPeerToken: "9614d658014f4151a95d8048fb717cf0",
    +    configuration: "Config1",
    +    cloudStorageOptions: .recreateLocalStoreOnModelMismatch
    +) else {
    +    // iCloud is not available on the device
    +    return
    +}
    +CoreStore.addStorage(
    +    storage,
    +    completion: { result in
    +        // ...
    +    }
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init?(ubiquitousContentName: String, ubiquitousContentTransactionLogsSubdirectory: String, ubiquitousContainerID: String? = nil, ubiquitousPeerToken: String? = nil, configuration: ModelConfiguration = nil, cloudStorageOptions: CloudStorageOptions = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + ubiquitousContentName + + +
    +

    the name of the store in iCloud. This is required and should not be empty, and should not contain periods (.).

    +
    +
    + + ubiquitousContentTransactionLogsSubdirectory + + +
    +

    a required relative path for the transaction logs

    +
    +
    + + ubiquitousContainerID + + +
    +

    a container if your app has multiple ubiquity container identifiers in its entitlements

    +
    +
    + + ubiquitousPeerToken + + +
    +

    a per-application salt to allow multiple apps on the same device to share a Core Data store integrated with iCloud

    +
    +
    + + configuration + + +
    +

    an optional configuration name from the model file. If not specified, defaults to nil, the Default configuration. Note that if you have multiple configurations, you will need to specify a different ubiquitousContentName explicitly for each of them.

    +
    +
    + + cloudStorageOptions + + +
    +

    When the ICloudStore is passed to the DataStack‘s addStorage() methods, tells the DataStack how to setup the persistent store. Defaults to .None.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + addObserver(_:) + +
    +
    +
    +
    +
    +
    +

    Registers an ICloudStoreObserver to start receive notifications from the ubiquitous store

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func addObserver<T>(_ observer: T) where T : ICloudStoreObserver
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + observer + + +
    +

    the observer to start sending ubiquitous notifications to

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + removeObserver(_:) + +
    +
    +
    +
    +
    +
    +

    Unregisters an ICloudStoreObserver to stop receiving notifications from the ubiquitous store

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func removeObserver(_ observer: ICloudStoreObserver)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + observer + + +
    +

    the observer to stop sending ubiquitous notifications to

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + storeType + +
    +
    +
    +
    +
    +
    +

    The string identifier for the NSPersistentStore‘s type property. For SQLiteStores, this is always set to NSSQLiteStoreType.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let storeType: String
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    +

    The configuration name in the model file

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let configuration: ModelConfiguration
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + storeOptions + +
    +
    +
    +
    +
    +
    +

    The options dictionary for the NSPersistentStore. For SQLiteStores, this is always set to

    +
    [NSSQLitePragmasOption: ["journal_mode": "WAL"]]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let storeOptions: [AnyHashable : Any]?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Do not call directly. Used by the DataStack internally.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cs_didAddToDataStack(_ dataStack: DataStack)
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Do not call directly. Used by the DataStack internally.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cs_didRemoveFromDataStack(_ dataStack: DataStack)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + cacheFileURL + +
    +
    +
    +
    +
    +
    +

    The NSURL that points to the ubiquity container file

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let cacheFileURL: URL
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cloudStorageOptions + +
    +
    +
    +
    +
    +
    +

    Options that tell the DataStack how to setup the persistent store

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var cloudStorageOptions: CloudStorageOptions
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The options dictionary for the specified CloudStorageOptions

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func dictionary(forOptions options: CloudStorageOptions) -> [AnyHashable : Any]?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Called by the DataStack to perform actual deletion of the store file from disk. Do not call directly! The sourceModel argument is a hint for the existing store’s model version. For SQLiteStore, this converts the database’s WAL journaling mode to DELETE before deleting the file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cs_eraseStorageAndWait(soureModel: NSManagedObjectModel) throws
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/InMemoryStore.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/InMemoryStore.html new file mode 100644 index 0000000..71de0f1 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/InMemoryStore.html @@ -0,0 +1,1081 @@ + + + + InMemoryStore Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

InMemoryStore

+
+
+
public final class InMemoryStore : StorageInterface
+ +
+
+

A storage interface that is backed only in memory.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + init(configuration:) + +
    +
    +
    +
    +
    +
    +

    Initializes an InMemoryStore for the specified configuration

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(configuration: ModelConfiguration)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + configuration + + +
    +

    an optional configuration name from the model file. If not specified, defaults to nil, the Default configuration.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes an InMemoryStore with the Default configuration

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + storeType + +
    +
    +
    +
    +
    +
    +

    The string identifier for the NSPersistentStore‘s type property. For InMemoryStores, this is always set to NSInMemoryStoreType.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let storeType: String
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    +

    The configuration name in the model file

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let configuration: ModelConfiguration
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + storeOptions + +
    +
    +
    +
    +
    +
    +

    The options dictionary for the NSPersistentStore. For InMemoryStores, this is always set to nil.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let storeOptions: [AnyHashable : Any]?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Do not call directly. Used by the DataStack internally.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cs_didAddToDataStack(_ dataStack: DataStack)
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Do not call directly. Used by the DataStack internally.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cs_didRemoveFromDataStack(_ dataStack: DataStack)
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/InferredSchemaMappingProvider.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/InferredSchemaMappingProvider.html new file mode 100644 index 0000000..5c88de3 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/InferredSchemaMappingProvider.html @@ -0,0 +1,895 @@ + + + + InferredSchemaMappingProvider Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

InferredSchemaMappingProvider

+
+
+
public final class InferredSchemaMappingProvider : Hashable, SchemaMappingProvider
+ +
+
+

A SchemaMappingProvider that tries to infer model migration between two DynamicSchema versions by searching all xcmappingmodels from Bundle.allBundles or by relying on lightweight migration if possible. Throws an error if lightweight migration is impossible for the two DynamicSchema. This mapping is automatically used as a fallback mapping provider, even if no mapping providers are explicitly declared in the StorageInterface.

+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: InferredSchemaMappingProvider, rhs: InferredSchemaMappingProvider) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/ListMonitor.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/ListMonitor.html new file mode 100644 index 0000000..059aca3 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/ListMonitor.html @@ -0,0 +1,2571 @@ + + + + ListMonitor Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ListMonitor

+
+
+
@available(OSX 10.12, *)
+public final class ListMonitor<D> : Hashable where D : DynamicObject
+ +
+
+

The ListMonitor monitors changes to a list of DynamicObject instances. Observers that implement the ListObserver protocol may then register themselves to the ListMonitor‘s addObserver(_:) method:

+
let monitor = CoreStore.monitorList(
+    From<Person>(),
+    Where("title", isEqualTo: "Engineer"),
+    OrderBy(.ascending("lastName"))
+)
+monitor.addObserver(self)
+
+ +

The ListMonitor instance needs to be held on (retained) for as long as the list needs to be observed. +Observers registered via addObserver(_:) are not retained. ListMonitor only keeps a weak reference to all observers, thus keeping itself free from retain-cycles.

+ +

Lists created with monitorList(...) keep a single-section list of objects, where each object can be accessed by index:

+
let firstPerson: MyPersonEntity = monitor[0]
+
+ +

Accessing the list with an index above the valid range will raise an exception.

+ +

Creating a sectioned-list is also possible with the monitorSectionedList(...) method:

+
let monitor = CoreStore.monitorSectionedList(
+    From<Person>(),
+    SectionBy("age") { "Age \($0)" },
+    Where("title", isEqualTo: "Engineer"),
+    OrderBy(.ascending("lastName"))
+)
+monitor.addObserver(self)
+
+ +

Objects from ListMonitors created this way can be accessed either by an IndexPath or a tuple:

+
let indexPath = IndexPath(forItem: 3, inSection: 2)
+let person1 = monitor[indexPath]
+let person2 = monitor[2, 3]
+
+ +

In the example above, both person1 and person2 will contain the object at section=2, index=3.

+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    +

    The type for the objects contained bye the ListMonitor

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = D
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the object at the given index within the first section. This subscript indexer is typically used for ListMonitors created with monitorList(_:).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(index: Int) -> ObjectType { get }
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + index + + +
    +

    the index of the object. Using an index above the valid range will raise an exception.

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject at the specified index

    +
    +
    +
    +
  • +
  • +
    + + + + subscript(safeIndex:) + +
    +
    +
    +
    +
    +
    +

    Returns the object at the given index, or nil if out of bounds. This subscript indexer is typically used for ListMonitors created with monitorList(_:).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(safeIndex index: Int) -> ObjectType? { get }
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + index + + +
    +

    the index for the object. Using an index above the valid range will return nil.

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject at the specified index, or nil if out of bounds

    +
    +
    +
    +
  • +
  • +
    + + + + subscript(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns the object at the given sectionIndex and itemIndex. This subscript indexer is typically used for ListMonitors created with monitorSectionedList(_:).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(sectionIndex: Int, itemIndex: Int) -> ObjectType { get }
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionIndex + + +
    +

    the section index for the object. Using a sectionIndex with an invalid range will raise an exception.

    +
    +
    + + itemIndex + + +
    +

    the index for the object within the section. Using an itemIndex with an invalid range will raise an exception.

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject at the specified section and item index

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the object at the given section and item index, or nil if out of bounds. This subscript indexer is typically used for ListMonitors created with monitorSectionedList(_:).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(safeSectionIndex sectionIndex: Int, safeItemIndex itemIndex: Int) -> ObjectType? { get }
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionIndex + + +
    +

    the section index for the object. Using a sectionIndex with an invalid range will return nil.

    +
    +
    + + itemIndex + + +
    +

    the index for the object within the section. Using an itemIndex with an invalid range will return nil.

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject at the specified section and item index, or nil if out of bounds

    +
    +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the object at the given IndexPath. This subscript indexer is typically used for ListMonitors created with monitorSectionedList(_:).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(indexPath: IndexPath) -> ObjectType { get }
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + indexPath + + +
    +

    the IndexPath for the object. Using an indexPath with an invalid range will raise an exception.

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject at the specified index path

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the object at the given IndexPath, or nil if out of bounds. This subscript indexer is typically used for ListMonitors created with monitorSectionedList(_:).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(safeIndexPath indexPath: IndexPath) -> ObjectType? { get }
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + indexPath + + +
    +

    the IndexPath for the object. Using an indexPath with an invalid range will return nil.

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject at the specified index path, or nil if out of bounds

    +
    +
    +
    +
  • +
  • +
    + + + + hasSections() + +
    +
    +
    +
    +
    +
    +

    Checks if the ListMonitor has at least one section

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hasSections() -> Bool
    + +
    +
    +
    +

    Return Value

    +

    true if at least one section exists, false otherwise

    +
    +
    +
    +
  • +
  • +
    + + + + hasObjects() + +
    +
    +
    +
    +
    +
    +

    Checks if the ListMonitor has at least one object in any section.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hasObjects() -> Bool
    + +
    +
    +
    +

    Return Value

    +

    true if at least one object in any section exists, false otherwise

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Checks if the ListMonitor has at least one object the specified section.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hasObjectsInSection(_ section: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will return false.

    +
    +
    +
    +
    +

    Return Value

    +

    true if at least one object in the specified section exists, false otherwise

    +
    +
    +
    +
  • +
  • +
    + + + + numberOfSections() + +
    +
    +
    +
    +
    +
    +

    Returns the number of sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func numberOfSections() -> Int
    + +
    +
    +
    +

    Return Value

    +

    the number of sections

    +
    +
    +
    +
  • +
  • +
    + + + + numberOfObjects() + +
    +
    +
    +
    +
    +
    +

    Returns the number of objects in all sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func numberOfObjects() -> Int
    + +
    +
    +
    +

    Return Value

    +

    the number of objects in all sections

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the number of objects in the specified section

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func numberOfObjectsInSection(_ section: Int) -> Int
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will raise an exception.

    +
    +
    +
    +
    +

    Return Value

    +

    the number of objects in the specified section

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the number of objects in the specified section, or nil if out of bounds.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func numberOfObjectsInSection(safeSectionIndex section: Int) -> Int?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will return nil.

    +
    +
    +
    +
    +

    Return Value

    +

    the number of objects in the specified section

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the NSFetchedResultsSectionInfo for the specified section

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func sectionInfoAtIndex(_ section: Int) -> NSFetchedResultsSectionInfo
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will raise an exception.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSFetchedResultsSectionInfo for the specified section

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the NSFetchedResultsSectionInfo for the specified section, or nil if out of bounds.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func sectionInfoAtIndex(safeSectionIndex section: Int) -> NSFetchedResultsSectionInfo?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will return nil.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSFetchedResultsSectionInfo for the specified section, or nil if the section index is out of bounds.

    +
    +
    +
    +
  • +
  • +
    + + + + sections() + +
    +
    +
    +
    +
    +
    +

    Returns the NSFetchedResultsSectionInfos for all sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func sections() -> [NSFetchedResultsSectionInfo]
    + +
    +
    +
    +

    Return Value

    +

    the NSFetchedResultsSectionInfos for all sections

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the target section for a specified Section Index title and index.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func targetSectionForSectionIndex(title: String, index: Int) -> Int
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + title + + +
    +

    the title of the Section Index

    +
    +
    + + index + + +
    +

    the index of the Section Index

    +
    +
    +
    +
    +

    Return Value

    +

    the target section for the specified Section Index title and index.

    +
    +
    +
    +
  • +
  • +
    + + + + sectionIndexTitles() + +
    +
    +
    +
    +
    +
    +

    Returns the section index titles for all sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func sectionIndexTitles() -> [String]
    + +
    +
    +
    +

    Return Value

    +

    the section index titles for all sections

    +
    +
    +
    +
  • +
  • +
    + + + + indexOf(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the index of the DynamicObject if it exists in the ListMonitor‘s fetched objects, or nil if not found.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func indexOf(_ object: ObjectType) -> Int?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the DynamicObject to search the index of

    +
    +
    +
    +
    +

    Return Value

    +

    the index of the DynamicObject if it exists in the ListMonitor‘s fetched objects, or nil if not found.

    +
    +
    +
    +
  • +
  • +
    + + + + indexPathOf(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the IndexPath of the DynamicObject if it exists in the ListMonitor‘s fetched objects, or nil if not found.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func indexPathOf(_ object: ObjectType) -> IndexPath?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the DynamicObject to search the index of

    +
    +
    +
    +
    +

    Return Value

    +

    the IndexPath of the DynamicObject if it exists in the ListMonitor‘s fetched objects, or nil if not found.

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + addObserver(_:) + +
    +
    +
    +
    +
    +
    +

    Registers a ListObserver to be notified when changes to the receiver’s list occur.

    + +

    To prevent retain-cycles, ListMonitor only keeps weak references to its observers.

    + +

    For thread safety, this method needs to be called from the main thread. An assertion failure will occur (on debug builds only) if called from any thread other than the main thread.

    + +

    Calling addObserver(_:) multiple times on the same observer is safe, as ListMonitor unregisters previous notifications to the observer before re-registering them.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func addObserver<U>(_ observer: U) where D == U.ListEntityType, U : ListObserver
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + observer + + +
    +

    a ListObserver to send change notifications to

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + addObserver(_:) + +
    +
    +
    +
    +
    +
    +

    Registers a ListObjectObserver to be notified when changes to the receiver’s list occur.

    + +

    To prevent retain-cycles, ListMonitor only keeps weak references to its observers.

    + +

    For thread safety, this method needs to be called from the main thread. An assertion failure will occur (on debug builds only) if called from any thread other than the main thread.

    + +

    Calling addObserver(_:) multiple times on the same observer is safe, as ListMonitor unregisters previous notifications to the observer before re-registering them.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func addObserver<U>(_ observer: U) where D == U.ListEntityType, U : ListObjectObserver
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + observer + + +
    +

    a ListObjectObserver to send change notifications to

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + addObserver(_:) + +
    +
    +
    +
    +
    +
    +

    Registers a ListSectionObserver to be notified when changes to the receiver’s list occur.

    + +

    To prevent retain-cycles, ListMonitor only keeps weak references to its observers.

    + +

    For thread safety, this method needs to be called from the main thread. An assertion failure will occur (on debug builds only) if called from any thread other than the main thread.

    + +

    Calling addObserver(_:) multiple times on the same observer is safe, as ListMonitor unregisters previous notifications to the observer before re-registering them.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func addObserver<U>(_ observer: U) where D == U.ListEntityType, U : ListSectionObserver
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + observer + + +
    +

    a ListSectionObserver to send change notifications to

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + removeObserver(_:) + +
    +
    +
    +
    +
    +
    +

    Unregisters a ListObserver from receiving notifications for changes to the receiver’s list.

    + +

    For thread safety, this method needs to be called from the main thread. An assertion failure will occur (on debug builds only) if called from any thread other than the main thread.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func removeObserver<U>(_ observer: U) where D == U.ListEntityType, U : ListObserver
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + observer + + +
    +

    a ListObserver to unregister notifications to

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + isPendingRefetch + +
    +
    +
    +
    +
    +
    +

    Returns true if a call to refetch(...) was made to the ListMonitor and is currently waiting for the fetching to complete. Returns false otherwise.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) var isPendingRefetch: Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + refetch(_:) + +
    +
    +
    +
    +
    +
    +

    Asks the ListMonitor to refetch its objects using the specified series of FetchClauses. Note that this method does not execute the fetch immediately; the actual fetching will happen after the NSFetchedResultsController‘s last controllerDidChangeContent(_:) notification completes.

    + +

    refetch(...) broadcasts listMonitorWillRefetch(...) to its observers immediately, and then listMonitorDidRefetch(...) after the new fetch request completes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func refetch(_ fetchClauses: FetchClause...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses. Important: Starting CoreStore 4.0, all FetchClauses required by the ListMonitor should be provided in the arguments list of refetch(...).

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + refetch(_:) + +
    +
    +
    +
    +
    +
    +

    Asks the ListMonitor to refetch its objects using the specified series of FetchClauses. Note that this method does not execute the fetch immediately; the actual fetching will happen after the NSFetchedResultsController‘s last controllerDidChangeContent(_:) notification completes.

    + +

    refetch(...) broadcasts listMonitorWillRefetch(...) to its observers immediately, and then listMonitorDidRefetch(...) after the new fetch request completes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func refetch(_ fetchClauses: [FetchClause])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses. Important: Starting CoreStore 4.0, all FetchClauses required by the ListMonitor should be provided in the arguments list of refetch(...).

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + userInfo + +
    +
    +
    +
    +
    +
    +

    Allow external libraries to store custom data in the ListMonitor. App code should rarely have a need for this.

    +
    enum Static {
    +    static var myDataKey: Void?
    +}
    +monitor.userInfo[&Static.myDataKey] = myObject
    +
    +
    +

    Important

    + Do not use this method to store thread-sensitive data. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let userInfo: UserInfo
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: ListMonitor<ObjectType>, rhs: ListMonitor<ObjectType>) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Returns all objects in all sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func objectsInAllSections() -> [ObjectType]
    + +
    +
    +
    +

    Return Value

    +

    all objects in all sections

    +
    +
    +
    +
  • +
  • +
    + + + + objectsInSection(_:) + +
    +
    +
    +
    +
    +
    +

    Returns all objects in the specified section

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func objectsInSection(_ section: Int) -> [ObjectType]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will raise an exception.

    +
    +
    +
    +
    +

    Return Value

    +

    all objects in the specified section

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns all objects in the specified section, or nil if out of bounds.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func objectsInSection(safeSectionIndex section: Int) -> [ObjectType]?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will return nil.

    +
    +
    +
    +
    +

    Return Value

    +

    all objects in the specified section

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Returns all objects in all sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func objectsInAllSections() -> [ObjectType]
    + +
    +
    +
    +

    Return Value

    +

    all objects in all sections

    +
    +
    +
    +
  • +
  • +
    + + + + objectsInSection(_:) + +
    +
    +
    +
    +
    +
    +

    Returns all objects in the specified section

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func objectsInSection(_ section: Int) -> [ObjectType]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will raise an exception.

    +
    +
    +
    +
    +

    Return Value

    +

    all objects in the specified section

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns all objects in the specified section, or nil if out of bounds.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func objectsInSection(safeSectionIndex section: Int) -> [ObjectType]?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + section + + +
    +

    the section index. Using an index outside the valid range will return nil.

    +
    +
    +
    +
    +

    Return Value

    +

    all objects in the specified section

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/ObjectMonitor.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/ObjectMonitor.html new file mode 100644 index 0000000..3d70cf4 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/ObjectMonitor.html @@ -0,0 +1,1099 @@ + + + + ObjectMonitor Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ObjectMonitor

+
+
+
@available(OSX 10.12, *)
+public final class ObjectMonitor<D> : Equatable where D : DynamicObject
+ +
+
+

The ObjectMonitor monitors changes to a single DynamicObject instance. Observers that implement the ObjectObserver protocol may then register themselves to the ObjectMonitor‘s addObserver(_:) method:

+
let monitor = CoreStore.monitorObject(object)
+monitor.addObserver(self)
+
+ +

The created ObjectMonitor instance needs to be held on (retained) for as long as the object needs to be observed.

+ +

Observers registered via addObserver(_:) are not retained. ObjectMonitor only keeps a weak reference to all observers, thus keeping itself free from retain-cycles.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    +

    The type for the object contained by the ObjectMonitor

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = D
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + object + +
    +
    +
    +
    +
    +
    +

    Returns the DynamicObject instance being observed, or nil if the object was already deleted.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var object: ObjectType? { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + isObjectDeleted + +
    +
    +
    +
    +
    +
    +

    Returns true if the DynamicObject instance being observed still exists, or false if the object was already deleted.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isObjectDeleted: Bool { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + addObserver(_:) + +
    +
    +
    +
    +
    +
    +

    Registers an ObjectObserver to be notified when changes to the receiver’s object are made.

    + +

    To prevent retain-cycles, ObjectMonitor only keeps weak references to its observers.

    + +

    For thread safety, this method needs to be called from the main thread. An assertion failure will occur (on debug builds only) if called from any thread other than the main thread.

    + +

    Calling addObserver(_:) multiple times on the same observer is safe, as ObjectMonitor unregisters previous notifications to the observer before re-registering them.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func addObserver<U>(_ observer: U) where D == U.ObjectEntityType, U : ObjectObserver
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + observer + + +
    +

    an ObjectObserver to send change notifications to

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + removeObserver(_:) + +
    +
    +
    +
    +
    +
    +

    Unregisters an ObjectObserver from receiving notifications for changes to the receiver’s object.

    + +

    For thread safety, this method needs to be called from the main thread. An assertion failure will occur (on debug builds only) if called from any thread other than the main thread.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func removeObserver<U>(_ observer: U) where D == U.ObjectEntityType, U : ObjectObserver
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + observer + + +
    +

    an ObjectObserver to unregister notifications to

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + userInfo + +
    +
    +
    +
    +
    +
    +

    Allow external libraries to store custom data in the ObjectMonitor. App code should rarely have a need for this.

    +
    enum Static {
    +    static var myDataKey: Void?
    +}
    +monitor.userInfo[&Static.myDataKey] = myObject
    +
    +
    +

    Important

    + Do not use this method to store thread-sensitive data. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let userInfo: UserInfo
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: ObjectMonitor<ObjectType>, rhs: ObjectMonitor<ObjectType>) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/SQLiteStore.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/SQLiteStore.html new file mode 100644 index 0000000..46abcdd --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/SQLiteStore.html @@ -0,0 +1,1524 @@ + + + + SQLiteStore Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SQLiteStore

+
+
+
public final class SQLiteStore : LocalStorage
+ +
+
+

A storage interface that is backed by an SQLite database.

+
+

Warning

+ The default SQLite file location for the LegacySQLiteStore and SQLiteStore are different. If the app was depending on CoreStore’s default directories prior to 2.0.0, make sure to use the SQLiteStore.legacy(...) factory methods to create the SQLiteStore instead of using initializers directly. + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes an SQLite store interface from the given SQLite file URL. When this instance is passed to the DataStack‘s addStorage() methods, a new SQLite file will be created if it does not exist.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(fileURL: URL, configuration: ModelConfiguration = nil, migrationMappingProviders: [SchemaMappingProvider] = [], localStorageOptions: LocalStorageOptions = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + fileURL + + +
    +

    the local file URL for the target SQLite persistent store. Note that if you have multiple configurations, you will need to specify a different fileURL explicitly for each of them.

    +
    +
    + + configuration + + +
    +

    an optional configuration name from the model file. If not specified, defaults to nil, the Default configuration. Note that if you have multiple configurations, you will need to specify a different fileURL explicitly for each of them.

    +
    +
    + + migrationMappingProviders + + +
    +

    an array of SchemaMappingProviders that provides the complete mapping models for custom migrations. All lightweight inferred mappings and/or migration mappings provided by *xcmappingmodel files are automatically used as fallback (as InferredSchemaMappingProvider) and may be omitted from the array.

    +
    +
    + + localStorageOptions + + +
    +

    When the SQLiteStore is passed to the DataStack‘s addStorage() methods, tells the DataStack how to setup the persistent store. Defaults to .none.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes an SQLite store interface from the given SQLite file name. When this instance is passed to the DataStack‘s addStorage() methods, a new SQLite file will be created if it does not exist.

    +
    +

    Warning

    + The default SQLite file location for the LegacySQLiteStore and SQLiteStore are different. If the app was depending on CoreStore’s default directories prior to 2.0.0, make sure to use the SQLiteStore.legacy(...) factory methods to create the SQLiteStore instead of using initializers directly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(fileName: String, configuration: ModelConfiguration = nil, migrationMappingProviders: [SchemaMappingProvider] = [], localStorageOptions: LocalStorageOptions = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + fileName + + +
    +

    the local filename for the SQLite persistent store in the Application Support/ directory (or the Caches/ directory on tvOS). Note that if you have multiple configurations, you will need to specify a different fileName explicitly for each of them.

    +
    +
    + + configuration + + +
    +

    an optional configuration name from the model file. If not specified, defaults to nil, the Default configuration. Note that if you have multiple configurations, you will need to specify a different fileName explicitly for each of them.

    +
    +
    + + migrationMappingProviders + + +
    +

    an array of SchemaMappingProviders that provides the complete mapping models for custom migrations. All lightweight inferred mappings and/or migration mappings provided by *xcmappingmodel files are automatically used as fallback (as InferredSchemaMappingProvider) and may be omitted from the array.

    +
    +
    + + localStorageOptions + + +
    +

    When the SQLiteStore is passed to the DataStack‘s addStorage() methods, tells the DataStack how to setup the persistent store. Defaults to .None.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes an SQLiteStore with an all-default settings: a fileURL pointing to a .sqlite file in the Application Support/ directory (or the Caches/ directory on tvOS), a nil configuration pertaining to the Default configuration, a migrationMappingProviders set to empty, and localStorageOptions set to .AllowProgresiveMigration.

    +
    +

    Warning

    + The default SQLite file location for the LegacySQLiteStore and SQLiteStore are different. If the app was depending on CoreStore’s default directories prior to 2.0.0, make sure to use the SQLiteStore.legacy(...) factory methods to create the SQLiteStore instead of using initializers directly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes an SQLite store interface from the given SQLite file name. When this instance is passed to the DataStack‘s addStorage() methods, a new SQLite file will be created if it does not exist.

    +
    +

    Warning

    + The default SQLite file location for the LegacySQLiteStore and SQLiteStore are different. If the app was depending on CoreStore’s default directories prior to 2.0.0, make sure to use the SQLiteStore.legacy(...) factory methods to create the SQLiteStore instead of using initializers directly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func legacy(fileName: String, configuration: ModelConfiguration = nil, migrationMappingProviders: [SchemaMappingProvider] = [], localStorageOptions: LocalStorageOptions = nil) -> SQLiteStore
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + legacyFileName + + +
    +

    the local filename for the SQLite persistent store in the Application Support directory (or the Caches directory on tvOS). Note that if you have multiple configurations, you will need to specify a different fileName explicitly for each of them.

    +
    +
    + + configuration + + +
    +

    an optional configuration name from the model file. If not specified, defaults to nil, the Default configuration. Note that if you have multiple configurations, you will need to specify a different fileName explicitly for each of them.

    +
    +
    + + migrationMappingProviders + + +
    +

    an array of SchemaMappingProviders that provides the complete mapping models for custom migrations. All lightweight inferred mappings and/or migration mappings provided by *xcmappingmodel files are automatically used as fallback (as InferredSchemaMappingProvider) and may be omitted from the array.

    +
    +
    + + localStorageOptions + + +
    +

    When the SQLiteStore is passed to the DataStack‘s addStorage() methods, tells the DataStack how to setup the persistent store. Defaults to .None.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + legacy() + +
    +
    +
    +
    +
    +
    +

    Initializes an LegacySQLiteStore with an all-default settings: a fileURL pointing to a .sqlite file in the Application Support directory (or the Caches directory on tvOS), a nil configuration pertaining to the Default configuration, a migrationMappingProviders set to empty, and localStorageOptions set to .AllowProgresiveMigration.

    +
    +

    Warning

    + The default SQLite file location for the LegacySQLiteStore and SQLiteStore are different. If the app was depending on CoreStore’s default directories prior to 2.0.0, make sure to use the SQLiteStore.legacy(...) factory methods to create the SQLiteStore instead of using initializers directly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func legacy() -> SQLiteStore
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fileSize() + +
    +
    +
    +
    +
    +
    +

    Queries the file size (in bytes) of the store, or nil if the file does not exist yet

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fileSize() -> UInt64?
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + storeType + +
    +
    +
    +
    +
    +
    +

    The string identifier for the NSPersistentStore‘s type property. For SQLiteStores, this is always set to NSSQLiteStoreType.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let storeType: String
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    +

    The configuration name in the model file

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let configuration: ModelConfiguration
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + storeOptions + +
    +
    +
    +
    +
    +
    +

    The options dictionary for the NSPersistentStore. For SQLiteStores, this is always set to

    +
    [NSSQLitePragmasOption: ["journal_mode": "WAL"]]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let storeOptions: [AnyHashable : Any]?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Do not call directly. Used by the DataStack internally.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cs_didAddToDataStack(_ dataStack: DataStack)
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Do not call directly. Used by the DataStack internally.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cs_didRemoveFromDataStack(_ dataStack: DataStack)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fileURL + +
    +
    +
    +
    +
    +
    +

    The NSURL that points to the SQLite file

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let fileURL: URL
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    An array of SchemaMappingProviders that provides the complete mapping models for custom migrations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let migrationMappingProviders: [SchemaMappingProvider]
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + localStorageOptions + +
    +
    +
    +
    +
    +
    +

    Options that tell the DataStack how to setup the persistent store

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var localStorageOptions: LocalStorageOptions
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The options dictionary for the specified LocalStorageOptions

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func dictionary(forOptions options: LocalStorageOptions) -> [AnyHashable : Any]?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Called by the DataStack to perform checkpoint operations on the storage. For SQLiteStore, this converts the database’s WAL journaling mode to DELETE to force a checkpoint.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cs_finalizeStorageAndWait(soureModelHint: NSManagedObjectModel) throws
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Called by the DataStack to perform actual deletion of the store file from disk. Do not call directly! The sourceModel argument is a hint for the existing store’s model version. For SQLiteStore, this converts the database’s WAL journaling mode to DELETE before deleting the file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cs_eraseStorageAndWait(metadata: [String : Any], soureModelHint: NSManagedObjectModel?) throws
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/SchemaHistory.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/SchemaHistory.html new file mode 100644 index 0000000..f9b1ef9 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/SchemaHistory.html @@ -0,0 +1,1153 @@ + + + + SchemaHistory Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SchemaHistory

+
+
+
public final class SchemaHistory : ExpressibleByArrayLiteral
+ +
+
+

The SchemaHistory encapsulates multiple DynamicSchema across multiple model versions. It contains all model history and is used by the DataStack to

+ +
+
+ +
+
+
+
    +
  • +
    + + + + currentModelVersion + +
    +
    +
    +
    +
    +
    +

    The version string for the current model version. The DataStack will try to migrate all StorageInterfaces added to itself to this version, following the version steps provided by the migrationChain.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let currentModelVersion: ModelVersion
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + currentSchema + +
    +
    +
    +
    +
    +
    +

    The schema for the current model version. The DataStack will try to migrate all StorageInterfaces added to itself to this version, following the version steps provided by the migrationChain.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var currentSchema: DynamicSchema { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + migrationChain + +
    +
    +
    +
    +
    +
    +

    The version string for the current model version. The DataStack will try to migrate all StorageInterfaces added to itself to this version, following the version steps provided by the migrationChain.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let migrationChain: MigrationChain
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Convenience initializer for a SchemaHistory created from a single xcdatamodeld file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(_ xcodeDataModeld: (allSchema: [XcodeDataModelSchema], currentModelVersion: ModelVersion), migrationChain: MigrationChain = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + xcodeDataModeld + + +
    +

    a tuple returned from the XcodeDataModelSchema.from(modelName:bundle:migrationChain:) method.

    +
    +
    + + migrationChain + + +
    +

    the MigrationChain that indicates the sequence of model versions to be used as the order for progressive migrations. If not specified, will default to a non-migrating data stack.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a SchemaHistory with a list of DynamicSchema and a MigrationChain to describe the order of progressive migrations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(_ schema: DynamicSchema, _ otherSchema: DynamicSchema..., migrationChain: MigrationChain = nil, exactCurrentModelVersion: String? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + schema + + +
    +

    a DynamicSchema that represents a model version

    +
    +
    + + otherSchema + + +
    +

    a list of DynamicSchema that represent other model versions

    +
    +
    + + migrationChain + + +
    +

    the MigrationChain that indicates the sequence of model versions to be used as the order for progressive migrations. If not specified, will default to a non-migrating data stack.

    +
    +
    + + exactCurrentModelVersion + + +
    +

    an optional string to explicitly select the current model version string. This is useful if the DataStack should load a non-latest model version (usually to prepare data before migration). If not provided, the current model version will be computed from the MigrationChain.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a SchemaHistory with a list of DynamicSchema and a MigrationChain to describe the order of progressive migrations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init(allSchema: [DynamicSchema], migrationChain: MigrationChain = nil, exactCurrentModelVersion: String? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + allSchema + + +
    +

    a list of DynamicSchema that represent model versions

    +
    +
    + + migrationChain + + +
    +

    the MigrationChain that indicates the sequence of model versions to be used as the order for progressive migrations. If not specified, will default to a non-migrating data stack.

    +
    +
    + + exactCurrentModelVersion + + +
    +

    an optional string to explicitly select the current model version string. This is useful if the DataStack should load a non-latest model version (usually to prepare data before migration). If not provided, the current model version will be computed from the MigrationChain.

    +
    +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/SynchronousDataTransaction.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/SynchronousDataTransaction.html new file mode 100644 index 0000000..c8146f0 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/SynchronousDataTransaction.html @@ -0,0 +1,1231 @@ + + + + SynchronousDataTransaction Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SynchronousDataTransaction

+
+
+
public final class SynchronousDataTransaction : BaseDataTransaction
+ +
+
+

The SynchronousDataTransaction provides an interface for DynamicObject creates, updates, and deletes. A transaction object should typically be only used from within a transaction block initiated from DataStack.beginSynchronous(_:), or from CoreStore.beginSynchronous(_:).

+ +
+
+ +
+
+
+
    +
  • +
    + + + + cancel() + +
    +
    +
    +
    +
    +
    +

    Cancels a transaction by throwing CoreStoreError.userCancelled.

    +
    try transaction.cancel()
    +
    +
    +

    Important

    + Always use plain try on a cancel() call. Never use try? or try!. Using try? will swallow the cancellation and the transaction will proceed to commit as normal. Using try! will crash the app as cancel() will always throw an error. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cancel() throws -> Never
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + create(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a new NSManagedObject or CoreStoreObject with the specified entity type.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override func create<D>(_ into: Into<D>) -> D where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + into + + +
    +

    the Into clause indicating the destination NSManagedObject or CoreStoreObject entity type and the destination configuration

    +
    +
    +
    +
    +

    Return Value

    +

    a new NSManagedObject or CoreStoreObject instance of the specified entity type.

    +
    +
    +
    +
  • +
  • +
    + + + + edit(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an editable proxy of a specified NSManagedObject or CoreStoreObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override func edit<D>(_ object: D?) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject or CoreStoreObject to be edited

    +
    +
    +
    +
    +

    Return Value

    +

    an editable proxy for the specified NSManagedObject or CoreStoreObject.

    +
    +
    +
    +
  • +
  • +
    + + + + edit(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an editable proxy of the object with the specified NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override func edit<D>(_ into: Into<D>, _ objectID: NSManagedObjectID) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + into + + +
    +

    an Into clause specifying the entity type

    +
    +
    + + objectID + + +
    +

    the NSManagedObjectID for the object to be edited

    +
    +
    +
    +
    +

    Return Value

    +

    an editable proxy for the specified NSManagedObject or CoreStoreObject.

    +
    +
    +
    +
  • +
  • +
    + + + + delete(_:) + +
    +
    +
    +
    +
    +
    +

    Deletes a specified NSManagedObject or CoreStoreObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override func delete<D>(_ object: D?) where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the NSManagedObject or CoreStoreObject type to be deleted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + delete(_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Deletes the specified DynamicObjects.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override func delete<D>(_ object1: D?, _ object2: D?, _ objects: D?...) where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + object1 + + +
    +

    the DynamicObject to be deleted

    +
    +
    + + object2 + + +
    +

    another DynamicObject to be deleted

    +
    +
    + + objects + + +
    +

    other DynamicObjects to be deleted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + delete(_:) + +
    +
    +
    +
    +
    +
    +

    Deletes the specified DynamicObjects.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override func delete<S>(_ objects: S) where S : Sequence, S.Element : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objects + + +
    +

    the DynamicObjects to be deleted

    +
    +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/UnsafeDataModelSchema.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/UnsafeDataModelSchema.html new file mode 100644 index 0000000..157b479 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/UnsafeDataModelSchema.html @@ -0,0 +1,987 @@ + + + + UnsafeDataModelSchema Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

UnsafeDataModelSchema

+
+
+
public final class UnsafeDataModelSchema : DynamicSchema
+ +
+
+

The UnsafeDataModelSchema describes models loaded directly from an existing NSManagedObjectModel. It is not advisable to continue using this model as its metadata are not available to CoreStore.

+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes a UnsafeDataModelSchema from an NSManagedObjectModel.

    +
    CoreStore.defaultStack = DataStack(
    +    UnsafeDataModelSchema(modelName: "MyAppV1", model: model)
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init(modelName: ModelVersion, model: NSManagedObjectModel)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + modelName + + +
    +

    the model version, typically the file name of an *.xcdatamodeld file (without the file extension)

    +
    +
    + + model + + +
    +

    the NSManagedObjectModel

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + modelVersion + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let modelVersion: ModelVersion
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + rawModel() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func rawModel() -> NSManagedObjectModel
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/UnsafeDataTransaction.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/UnsafeDataTransaction.html new file mode 100644 index 0000000..7d18082 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/UnsafeDataTransaction.html @@ -0,0 +1,2281 @@ + + + + UnsafeDataTransaction Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

UnsafeDataTransaction

+
+
+
public final class UnsafeDataTransaction : BaseDataTransaction
+ +
+
+

The UnsafeDataTransaction provides an interface for non-contiguous NSManagedObject or CoreStoreObject creates, updates, and deletes. This is useful for making temporary changes, such as partially filled forms. An unsafe transaction object should typically be only used from the main queue.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + commit(_:) + +
    +
    +
    +
    +
    +
    +

    Saves the transaction changes asynchronously. For an UnsafeDataTransaction, multiple commits are allowed, although it is the developer’s responsibility to ensure a reasonable leeway to prevent blocking the main thread.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func commit(_ completion: @escaping (_ error: CoreStoreError?) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + completion + + +
    +

    the block executed after the save completes. Success or failure is reported by the optional error argument of the block.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + commitAndWait() + +
    +
    +
    +
    +
    +
    +

    Saves the transaction changes and waits for completion synchronously. For an UnsafeDataTransaction, multiple commits are allowed, although it is the developer’s responsibility to ensure a reasonable leeway to prevent blocking the main thread.

    +
    +

    Throws

    + a CoreStoreError value indicating the failure. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func commitAndWait() throws
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + rollback() + +
    +
    +
    +
    +
    +
    +

    Rolls back the transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func rollback()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + undo() + +
    +
    +
    +
    +
    +
    +

    Undo’s the last change made to the transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func undo()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + flush() + +
    +
    +
    +
    +
    +
    +

    Immediately flushes all pending changes to the transaction’s observers. This is useful in conjunction with ListMonitors and ObjectMonitors created from UnsafeDataTransactions used to manage temporary scratch data.

    +
    +

    Important

    + Note that unlike commit(), flush() does not propagate/save updates to the DataStack and the persistent store. However, the flushed changes will be seen by children transactions created further from the current transaction (i.e. through transaction.beginUnsafe()) + +
    +
    +

    Throws

    + an error thrown from closure, or an error thrown by Core Data (usually validation errors or conflict errors) + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func flush()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + flush(closure:) + +
    +
    +
    +
    +
    +
    +

    Flushes all pending changes to the transaction’s observers at the end of the closure‘s execution. This is useful in conjunction with ListMonitors and ObjectMonitors created from UnsafeDataTransactions used to manage temporary scratch data.

    +
    +

    Important

    + Note that unlike commit(), flush() does not propagate/save updates to the DataStack and the persistent store. However, the flushed changes will be seen by children transactions created further from the current transaction (i.e. through transaction.beginUnsafe()) + +
    +
    +

    Throws

    + an error thrown from closure, or an error thrown by Core Data (usually validation errors or conflict errors) + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func flush(closure: () throws -> Void) rethrows
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + closure + + +
    +

    the closure where changes can be made prior to the flush

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + redo() + +
    +
    +
    +
    +
    +
    +

    Redo’s the last undone change to the transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func redo()
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Begins a child transaction where NSManagedObject or CoreStoreObject creates, updates, and deletes can be made. This is useful for making temporary changes, such as partially filled forms.

    + +
      +
    • prameter supportsUndo: undo(), redo(), and rollback() methods are only available when this parameter is true, otherwise those method will raise an exception. Defaults to false. Note that turning on Undo support may heavily impact performance especially on iOS or watchOS where memory is limited.
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func beginUnsafe(supportsUndo: Bool = false) -> UnsafeDataTransaction
    + +
    +
    +
    +

    Return Value

    +

    an UnsafeDataTransaction instance where creates, updates, and deletes can be made.

    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Utility for creating an NSFetchedResultsController from the UnsafeDataTransaction. This is useful when an NSFetchedResultsController is preferred over the overhead of ListMonitors abstraction.

    +
    +

    Note

    +

    It is the caller’s responsibility to call performFetch() on the created NSFetchedResultsController.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func createFetchedResultsController<D>(_ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: FetchClause...) -> NSFetchedResultsController<D> where D : NSManagedObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    an NSFetchedResultsController that observes the UnsafeDataTransaction

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Utility for creating an NSFetchedResultsController from the UnsafeDataTransaction. This is useful when an NSFetchedResultsController is preferred over the overhead of ListMonitors abstraction.

    +
    +

    Note

    +

    It is the caller’s responsibility to call performFetch() on the created NSFetchedResultsController.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func createFetchedResultsController<D>(_ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: [FetchClause]) -> NSFetchedResultsController<D> where D : NSManagedObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    an NSFetchedResultsController that observes the UnsafeDataTransaction

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Utility for creating an NSFetchedResultsController from the UnsafeDataTransaction. This is useful when an NSFetchedResultsController is preferred over the overhead of ListMonitors abstraction.

    +
    +

    Note

    +

    It is the caller’s responsibility to call performFetch() on the created NSFetchedResultsController.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func createFetchedResultsController<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> NSFetchedResultsController<D> where D : NSManagedObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    an NSFetchedResultsController that observes the UnsafeDataTransaction

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Utility for creating an NSFetchedResultsController from the UnsafeDataTransaction. This is useful when an NSFetchedResultsController is preferred over the overhead of ListMonitors abstraction.

    +
    +

    Note

    +

    It is the caller’s responsibility to call performFetch() on the created NSFetchedResultsController.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func createFetchedResultsController<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> NSFetchedResultsController<D> where D : NSManagedObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    an NSFetchedResultsController that observes the UnsafeDataTransaction

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + monitorObject(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ObjectMonitor for the specified DynamicObject. Multiple ObjectObservers may then register themselves to be notified when changes are made to the DynamicObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorObject<D>(_ object: D) -> ObjectMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the DynamicObject to observe changes from

    +
    +
    +
    +
    +

    Return Value

    +

    a ObjectMonitor that monitors changes to object

    +
    +
    +
    +
  • +
  • +
    + + + + monitorList(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ListMonitor for a list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorList<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> ListMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • +
    + + + + monitorList(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ListMonitor for a list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorList<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> ListMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • +
    + + + + monitorList(_:) + +
    +
    +
    +
    +
    +
    +

    Asynchronously creates a ListMonitor for a list of DynamicObjects that satisfy the specified FetchChainableBuilderType built from a chain of clauses. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    +
    transaction.monitorList(
    +    { (monitor) in
    +        self.monitor = monitor
    +    },
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorList<B>(_ clauseChain: B) -> ListMonitor<B.ObjectType> where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor for a list of DynamicObjects that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a ListMonitor for a list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorList<D>(createAsynchronously: @escaping (ListMonitor<D>) -> Void, _ from: From<D>, _ fetchClauses: FetchClause...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a ListMonitor for a list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorList<D>(createAsynchronously: @escaping (ListMonitor<D>) -> Void, _ from: From<D>, _ fetchClauses: [FetchClause])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorSectionedList<D>(_ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: FetchClause...) -> ListMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorSectionedList<D>(_ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: [FetchClause]) -> ListMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified SectionMonitorBuilderType built from a chain of clauses.

    +
    let monitor = transaction.monitorSectionedList(
    +    From<MyPersonEntity>()
    +        .sectionBy(\.age, { "\($0!) years old" })
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorSectionedList<B>(_ clauseChain: B) -> ListMonitor<B.ObjectType> where B : SectionMonitorBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a SectionMonitorBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor for a list of DynamicObjects that satisfy the specified SectionMonitorBuilderType

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorSectionedList<D>(createAsynchronously: @escaping (ListMonitor<D>) -> Void, _ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: FetchClause...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorSectionedList<D>(createAsynchronously: @escaping (ListMonitor<D>) -> Void, _ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: [FetchClause])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified SectionMonitorBuilderType built from a chain of clauses.

    +
    transaction.monitorSectionedList(
    +    { (monitor) in
    +        self.monitor = monitor
    +    },
    +    From<MyPersonEntity>()
    +        .sectionBy(\.age, { "\($0!) years old" })
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func monitorSectionedList<B: SectionMonitorBuilderType>(createAsynchronously: @escaping (ListMonitor<B.ObjectType>) -> Void, _ clauseChain: B)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a SectionMonitorBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor for a list of DynamicObjects that satisfy the specified SectionMonitorBuilderType

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/UserInfo.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/UserInfo.html new file mode 100644 index 0000000..ea5b658 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/UserInfo.html @@ -0,0 +1,926 @@ + + + + UserInfo Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

UserInfo

+
+
+
public final class UserInfo
+ +
+
+

The UserInfo class is provided by several CoreStore types such as DataStack, ListMonitor, ObjectMonitor and transactions to allow external libraries or user apps to store their own custom data.

+
enum Static {
+    static var myDataKey: Void?
+}
+CoreStore.defaultStack.userInfo[&Static.myDataKey] = myObject
+
+
+

Important

+ Do not use this class to store thread-sensitive data. + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Allows external libraries to store custom data. App code should rarely have a need for this.

    +
    enum Static {
    +   static var myDataKey: Void?
    +}
    +CoreStore.defaultStack.userInfo[&Static.myDataKey] = myObject
    +
    +
    +

    Important

    + Do not use this method to store thread-sensitive data. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(key: UnsafeRawPointer) -> Any? { get set }
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + key + + +
    +

    the key for custom data. Make sure this is a static pointer that will never be changed.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Allows external libraries to store custom data in the DataStack. App code should rarely have a need for this.

    +
    enum Static {
    +    static var myDataKey: Void?
    +}
    +CoreStore.defaultStack.userInfo[&Static.myDataKey, lazyInit: { MyObject() }] = myObject
    +
    +
    +

    Important

    + Do not use this method to store thread-sensitive data. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(key: UnsafeRawPointer, lazyInit closure: () -> Any) -> Any { get }
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + key + + +
    +

    the key for custom data. Make sure this is a static pointer that will never be changed.

    +
    +
    + + lazyInit + + +
    +

    a closure to use to lazily-initialize the data

    +
    +
    +
    +
    +

    Return Value

    +

    A custom data identified by key

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/XcodeDataModelSchema.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/XcodeDataModelSchema.html new file mode 100644 index 0000000..6cdf3bf --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/XcodeDataModelSchema.html @@ -0,0 +1,1127 @@ + + + + XcodeDataModelSchema Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

XcodeDataModelSchema

+
+
+
public final class XcodeDataModelSchema : DynamicSchema
+ +
+
+

The XcodeDataModelSchema describes a model version declared in a single *.xcdatamodeld file.

+
CoreStore.defaultStack = DataStack(
+    XcodeDataModelSchema(modelName: "MyAppV1", bundle: .main)
+)
+
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Creates a XcodeDataModelSchema for each of the models declared in the specified (.xcdatamodeld) model file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func from(modelName: XcodeDataModelFileName, bundle: Bundle = Bundle.main, migrationChain: MigrationChain = nil) -> (allSchema: [XcodeDataModelSchema], currentModelVersion: ModelVersion)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + modelName + + +
    +

    the name of the (.xcdatamodeld) model file. If not specified, the application name (CFBundleName) will be used if it exists, or CoreData if it the bundle name was not set.

    +
    +
    + + bundle + + +
    +

    an optional bundle to load models from. If not specified, the main bundle will be used.

    +
    +
    + + migrationChain + + +
    +

    the MigrationChain that indicates the sequence of model versions to be used as the order for progressive migrations. If not specified, will default to a non-migrating data stack.

    +
    +
    +
    +
    +

    Return Value

    +

    a tuple containing all XcodeDataModelSchema for the models declared in the specified .xcdatamodeld file, and the current model version string declared or inferred from the file.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes an XcodeDataModelSchema from an *.xcdatamodeld version name and its containing Bundle.

    +
    CoreStore.defaultStack = DataStack(
    +    XcodeDataModelSchema(modelName: "MyAppV1", bundle: .main)
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(modelName: ModelVersion, bundle: Bundle = Bundle.main)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + modelName + + +
    +

    the model version, typically the file name of an *.xcdatamodeld file (without the file extension)

    +
    +
    + + bundle + + +
    +

    the Bundle that contains the .xcdatamodeld’s momd file. If not specified, the Bundle.main will be searched.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes an XcodeDataModelSchema from an *.xcdatamodeld file URL.

    +
    CoreStore.defaultStack = DataStack(
    +    XcodeDataModelSchema(modelName: "MyAppV1", modelVersionFileURL: fileURL)
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init(modelName: ModelVersion, modelVersionFileURL: URL)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + modelName + + +
    +

    the model version, typically the file name of an *.xcdatamodeld file (without the file extension)

    +
    +
    + + modelVersionFileURL + + +
    +

    the file URL that points to the .xcdatamodeld’s momd file.

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + modelVersion + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let modelVersion: ModelVersion
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + rawModel() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func rawModel() -> NSManagedObjectModel
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/XcodeSchemaMappingProvider.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/XcodeSchemaMappingProvider.html new file mode 100644 index 0000000..0b422eb --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Classes/XcodeSchemaMappingProvider.html @@ -0,0 +1,1050 @@ + + + + XcodeSchemaMappingProvider Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

XcodeSchemaMappingProvider

+
+
+
public final class XcodeSchemaMappingProvider : Hashable, SchemaMappingProvider
+ +
+
+

A SchemaMappingProvider that tries to infer model migration between two DynamicSchema versions by loading an xcmappingmodel file from the specified Bundle. Throws CoreStoreError.mappingModelNotFound if the xcmappingmodel file cannot be found, or if the xcmappingmodel doesn’t resolve the source and destination DynamicSchema.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + sourceVersion + +
    +
    +
    +
    +
    +
    +

    The source model version for the mapping.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let sourceVersion: ModelVersion
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + destinationVersion + +
    +
    +
    +
    +
    +
    +

    The destination model version for the mapping.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let destinationVersion: ModelVersion
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + mappingModelBundle + +
    +
    +
    +
    +
    +
    +

    The Bundle that contains the xcmappingmodel file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let mappingModelBundle: Bundle
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates an XcodeSchemaMappingProvider

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init(from sourceVersion: ModelVersion, to destinationVersion: ModelVersion, mappingModelBundle: Bundle)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + sourceVersion + + +
    +

    the source model version for the mapping

    +
    +
    + + destinationVersion + + +
    +

    the destination model version for the mapping

    +
    +
    + + mappingModelBundle + + +
    +

    the Bundle that contains the xcmappingmodel file

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: XcodeSchemaMappingProvider, rhs: XcodeSchemaMappingProvider) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums.html new file mode 100644 index 0000000..8f039a1 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums.html @@ -0,0 +1,1357 @@ + + + + Enumerations Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Enumerations

+

The following enumerations are available globally.

+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + CSErrorCode + +
    +
    +
    +
    +
    +
    +

    The NSError error codes for CSError.Domain.

    +
    +

    See also

    + CSError + +
    +
    +

    See also

    + CoreStoreError + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public enum CSErrorCode : Int
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CoreStoreError + +
    +
    +
    +
    +
    +
    +

    All errors thrown from CoreStore are expressed in CoreStoreError enum values.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum CoreStoreError : Error, CustomNSError, Hashable
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + MigrationResult + +
    +
    +
    +
    +
    +
    +

    The MigrationResult indicates the result of a migration. +The MigrationResult can be treated as a boolean:

    +
    CoreStore.upgradeStorageIfNeeded(SQLiteStorage(fileName: "data.sqlite")) { (result) in
    +    switch result {
    +    case .success(let migrationSteps):
    +        // ...
    +    case .failure(let error):
    +        // ...
    +    }
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum MigrationResult : Hashable
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + MigrationType + +
    +
    +
    +
    +
    +
    +

    The MigrationType specifies the type of migration required for a store.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum MigrationType : Hashable
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + SelectTerm + +
    +
    +
    +
    +
    +
    +

    The SelectTerm is passed to the Select clause to indicate the attributes/aggregate keys to be queried.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum SelectTerm<D> : ExpressibleByStringLiteral, Hashable where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + SetupResult + +
    +
    +
    +
    +
    +
    +

    The SetupResult indicates the result of an asynchronous initialization of a persistent store. +The SetupResult can be treated as a boolean:

    +
    try! CoreStore.addStorage(
    +    SQLiteStore(),
    +    completion: { (result: SetupResult) -> Void in
    +        if result {
    +            // succeeded
    +        }
    +        else {
    +            // failed
    +        }
    +    }
    +)
    +
    + +

    or as an enum, where the resulting associated object can also be inspected:

    +
    try! CoreStore.addStorage(
    +    SQLiteStore(),
    +    completion: { (result: SetupResult) -> Void in
    +        switch result {
    +        case .success(let storage):
    +            // storage is the related StorageInterface instance
    +        case .failure(let error):
    +            // error is the CoreStoreError enum value for the failure
    +        }
    +    }
    +)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum SetupResult<T> : Hashable where T : StorageInterface
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CoreStore + +
    +
    +
    +
    +
    +
    +

    CoreStore is the main entry point for all other APIs.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum CoreStore
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + LogLevel + +
    +
    +
    +
    +
    +
    +

    The LogLevel indicates the severity of a log message.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum LogLevel
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ValueContainer + +
    +
    +
    +
    +
    +
    +

    The containing type for value properties. Use the DynamicObject.Value typealias instead for shorter syntax.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let nickname = Value.Optional<String>("nickname")
    +    let color = Transformable.Optional<UIColor>("color")
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum ValueContainer<O> where O : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    The containing type for transformable properties. Use the DynamicObject.Transformable typealias instead for shorter syntax.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let nickname = Value.Optional<String>("nickname")
    +    let color = Transformable.Optional<UIColor>("color")
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum TransformableContainer<O> where O : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + RelationshipContainer + +
    +
    +
    +
    +
    +
    +

    The containing type for relationships. Use the DynamicObject.Relationship typealias instead for shorter syntax.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyUnordered<Dog>("pets", inverse: { $0.master })
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum RelationshipContainer<O> where O : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/CSErrorCode.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/CSErrorCode.html new file mode 100644 index 0000000..54c729c --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/CSErrorCode.html @@ -0,0 +1,988 @@ + + + + CSErrorCode Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSErrorCode

+
+
+
@objc
+public enum CSErrorCode : Int
+ +
+
+

The NSError error codes for CSError.Domain.

+
+

See also

+ CSError + +
+
+

See also

+ CoreStoreError + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + unknownError + +
    +
    +
    +
    +
    +
    +

    A failure occured because of an unknown error.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case unknownError
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The NSPersistentStore could note be initialized because another store existed at the specified NSURL.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case differentStorageExistsAtURL
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + mappingModelNotFound + +
    +
    +
    +
    +
    +
    +

    An NSMappingModel could not be found for a specific source and destination model versions.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case mappingModelNotFound
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Progressive migrations are disabled for a store, but an NSMappingModel could not be found for a specific source and destination model versions.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case progressiveMigrationRequired
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + internalError + +
    +
    +
    +
    +
    +
    +

    An internal SDK call failed with the specified NSError userInfo key.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case internalError
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + userError + +
    +
    +
    +
    +
    +
    +

    The transaction was terminated by a user-thrown error with the specified Error userInfo key.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case userError
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + userCancelled + +
    +
    +
    +
    +
    +
    +

    The transaction was cancelled by the user.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case userCancelled
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/CSLocalStorageOptions.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/CSLocalStorageOptions.html new file mode 100644 index 0000000..47b940b --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/CSLocalStorageOptions.html @@ -0,0 +1,902 @@ + + + + CSLocalStorageOptions Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSLocalStorageOptions

+
+
+
@objc
+public enum CSLocalStorageOptions : Int
+ +
+
+

The CSLocalStorageOptions provides settings that tells the CSDataStack how to setup the persistent store for CSLocalStorage implementers.

+
+

See also

+ LocalStorageOptions + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + none + +
    +
    +
    +
    +
    +
    +

    Tells the DataStack that the store should not be migrated or recreated, and should simply fail on model mismatch

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case none = 0
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Tells the DataStack to delete and recreate the store on model mismatch, otherwise exceptions will be thrown on failure instead

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case recreateStoreOnModelMismatch = 1
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Tells the DataStack to prevent progressive migrations for the store

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case preventProgressiveMigration = 2
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Tells the DataStack to allow lightweight migration for the store when added synchronously

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case allowSynchronousLightweightMigration = 4
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/CoreStore.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/CoreStore.html new file mode 100644 index 0000000..e79291f --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/CoreStore.html @@ -0,0 +1,4269 @@ + + + + CoreStore Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CoreStore

+
+
+
public enum CoreStore
+ +
+
+

CoreStore is the main entry point for all other APIs.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + defaultStack + +
    +
    +
    +
    +
    +
    +

    The default DataStack instance to be used. If defaultStack is not set before the first time accessed, a default-configured DataStack will be created.

    +
    +

    See also

    + DataStack + +
    +
    +

    Note

    + Changing the defaultStack is thread safe, but it is recommended to setup DataStacks on a common queue (e.g. the main queue). + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static var defaultStack: DataStack { get set }
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Asynchronously adds a StorageInterface to the defaultStack. Migrations are also initiated by default.

    +
    CoreStore.addStorage(
    +    InMemoryStore(configuration: "Config1"),
    +    completion: { result in
    +        switch result {
    +        case .success(let storage): // ...
    +        case .failure(let error): // ...
    +        }
    +    }
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func addStorage<T>(_ storage: T, completion: @escaping (SetupResult<T>) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the storage

    +
    +
    + + completion + + +
    +

    the closure to be executed on the main queue when the process completes, either due to success or failure. The closure’s SetupResult argument indicates the result. Note that the StorageInterface associated to the SetupResult.success may not always be the same instance as the parameter argument if a previous StorageInterface was already added at the same URL and with the same configuration.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously adds a LocalStorage to the defaultStack. Migrations are also initiated by default.

    +
    let migrationProgress = CoreStore.addStorage(
    +    SQLiteStore(fileName: "core_data.sqlite", configuration: "Config1"),
    +    completion: { result in
    +        switch result {
    +        case .success(let storage): // ...
    +        case .failure(let error): // ...
    +        }
    +    }
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func addStorage<T: LocalStorage>(_ storage: T, completion: @escaping (SetupResult<T>) -> Void) -> Progress?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the local storage

    +
    +
    + + completion + + +
    +

    the closure to be executed on the main queue when the process completes, either due to success or failure. The closure’s SetupResult argument indicates the result. Note that the LocalStorage associated to the SetupResult.success may not always be the same instance as the parameter argument if a previous LocalStorage was already added at the same URL and with the same configuration.

    +
    +
    +
    +
    +

    Return Value

    +

    a Progress instance if a migration has started, or nil if either no migrations are required or if a failure occured.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously adds a CloudStorage to the defaultStack. Migrations are also initiated by default.

    +
    guard let storage = ICloudStore(
    +    ubiquitousContentName: "MyAppCloudData",
    +    ubiquitousContentTransactionLogsSubdirectory: "logs/config1",
    +    ubiquitousContainerID: "iCloud.com.mycompany.myapp.containername",
    +    ubiquitousPeerToken: "9614d658014f4151a95d8048fb717cf0",
    +    configuration: "Config1",
    +    cloudStorageOptions: .recreateLocalStoreOnModelMismatch
    +) else {
    +    // iCloud is not available on the device
    +    return
    +}
    +let migrationProgress = dataStack.addStorage(
    +    storage,
    +    completion: { result in
    +        switch result {
    +        case .success(let storage): // ...
    +        case .failure(let error): // ...
    +        }
    +    }
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func addStorage<T: CloudStorage>(_ storage: T, completion: @escaping (SetupResult<T>) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the cloud storage

    +
    +
    + + completion + + +
    +

    the closure to be executed on the main queue when the process completes, either due to success or failure. The closure’s SetupResult argument indicates the result. Note that the CloudStorage associated to the SetupResult.success may not always be the same instance as the parameter argument if a previous CloudStorage was already added at the same URL and with the same configuration.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Migrates a local storage to match the defaultStack‘s managed object model version. This method does NOT add the migrated store to the data stack.

    +
    +

    Throws

    + a CoreStoreError value indicating the failure + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func upgradeStorageIfNeeded<T: LocalStorage>(_ storage: T, completion: @escaping (MigrationResult) -> Void) throws -> Progress?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the local storage

    +
    +
    + + completion + + +
    +

    the closure to be executed on the main queue when the migration completes, either due to success or failure. The closure’s MigrationResult argument indicates the result. This closure is NOT executed if an error is thrown, but will be executed with a .failure result if an error occurs asynchronously.

    +
    +
    +
    +
    +

    Return Value

    +

    a Progress instance if a migration has started, or nil is no migrations are required

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Checks the migration steps required for the storage to match the defaultStack‘s managed object model version.

    +
    +

    Throws

    + a CoreStoreError value indicating the failure + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func requiredMigrationsForStorage<T>(_ storage: T) throws -> [MigrationType] where T : LocalStorage
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + storage + + +
    +

    the local storage

    +
    +
    +
    +
    +

    Return Value

    +

    a MigrationType array indicating the migration steps required for the store, or an empty array if the file does not exist yet. Otherwise, an error is thrown if either inspection of the store failed, or if no mapping model was found/inferred.

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + monitorObject(_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, creates an ObjectMonitor for the specified DynamicObject. Multiple ObjectObservers may then register themselves to be notified when changes are made to the DynamicObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func monitorObject<D>(_ object: D) -> ObjectMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    the DynamicObject to observe changes from

    +
    +
    +
    +
    +

    Return Value

    +

    a ObjectMonitor that monitors changes to object

    +
    +
    +
    +
  • +
  • +
    + + + + monitorList(_:_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, creates a ListMonitor for a list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func monitorList<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> ListMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • +
    + + + + monitorList(_:_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, creates a ListMonitor for a list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func monitorList<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> ListMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • +
    + + + + monitorList(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ListMonitor for a list of DynamicObjects that satisfy the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let monitor = CoreStore.monitorList(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func monitorList<B>(_ clauseChain: B) -> ListMonitor<B.ObjectType> where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor for a list of DynamicObjects that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, asynchronously creates a ListMonitor for a list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func monitorList<D>(createAsynchronously: @escaping (ListMonitor<D>) -> Void, _ from: From<D>, _ fetchClauses: FetchClause...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, asynchronously creates a ListMonitor for a list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func monitorList<D>(createAsynchronously: @escaping (ListMonitor<D>) -> Void, _ from: From<D>, _ fetchClauses: [FetchClause])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a ListMonitor for a list of DynamicObjects that satisfy the specified FetchChainableBuilderType built from a chain of clauses. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    +
    CoreStore.monitorList(
    +    { (monitor) in
    +        self.monitor = monitor
    +    },
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func monitorList<B: FetchChainableBuilderType>(createAsynchronously: @escaping (ListMonitor<B.ObjectType>) -> Void, _ clauseChain: B)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor for a list of DynamicObjects that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func monitorSectionedList<D>(_ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: FetchClause...) -> ListMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func monitorSectionedList<D>(_ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: [FetchClause]) -> ListMonitor<D> where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor instance that monitors changes to the list

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified SectionMonitorBuilderType built from a chain of clauses.

    +
    let monitor = CoreStore.monitorSectionedList(
    +    From<MyPersonEntity>()
    +        .sectionBy(\.age, { "\($0!) years old" })
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func monitorSectionedList<B>(_ clauseChain: B) -> ListMonitor<B.ObjectType> where B : SectionMonitorBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a SectionMonitorBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor for a list of DynamicObjects that satisfy the specified SectionMonitorBuilderType

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, asynchronously creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func monitorSectionedList<D>(createAsynchronously: @escaping (ListMonitor<D>) -> Void, _ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: FetchClause...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, asynchronously creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified fetch clauses. Multiple ListObservers may then register themselves to be notified when changes are made to the list. Since NSFetchedResultsController greedily locks the persistent store on initial fetch, you may prefer this method instead of the synchronous counterpart to avoid deadlocks while background updates/saves are being executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func monitorSectionedList<D>(createAsynchronously: @escaping (ListMonitor<D>) -> Void, _ from: From<D>, _ sectionBy: SectionBy<D>, _ fetchClauses: [FetchClause])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + createAsynchronously + + +
    +

    the closure that receives the created ListMonitor instance

    +
    +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + sectionBy + + +
    +

    a SectionBy clause indicating the keyPath for the attribute to use when sorting the list into sections.

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for fetching the object list. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously creates a ListMonitor for a sectioned list of DynamicObjects that satisfy the specified SectionMonitorBuilderType built from a chain of clauses.

    +
    CoreStore.monitorSectionedList(
    +    { (monitor) in
    +        self.monitor = monitor
    +    },
    +    From<MyPersonEntity>()
    +        .sectionBy(\.age, { "\($0!) years old" })
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func monitorSectionedList<B: SectionMonitorBuilderType>(createAsynchronously: @escaping (ListMonitor<B.ObjectType>) -> Void, _ clauseChain: B)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a SectionMonitorBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    a ListMonitor for a list of DynamicObjects that satisfy the specified SectionMonitorBuilderType

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the DynamicObject instance in the DataStack‘s context from a reference created from a transaction or from a different managed object context.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchExisting<D>(_ object: D) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    a reference to the object created/fetched outside the DataStack

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject instance if the object exists in the DataStack, or nil if not found.

    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the DynamicObject instance in the DataStack‘s context from an NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchExisting<D>(_ objectID: NSManagedObjectID) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objectID + + +
    +

    the NSManagedObjectID for the object

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject instance if the object exists in the DataStack, or nil if not found.

    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the DynamicObject instances in the DataStack‘s context from references created from a transaction or from a different managed object context.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchExisting<D, S>(_ objects: S) -> [D] where D : DynamicObject, D == S.Element, S : Sequence
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objects + + +
    +

    an array of DynamicObjects created/fetched outside the DataStack

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject array for objects that exists in the DataStack

    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the DynamicObject instances in the DataStack‘s context from a list of NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchExisting<D, S>(_ objectIDs: S) -> [D] where D : DynamicObject, S : Sequence, S.Element == NSManagedObjectID
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objectIDs + + +
    +

    the NSManagedObjectID array for the objects

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject array for objects that exists in the DataStack

    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the first DynamicObject instance that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the first DynamicObject instance that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the first DynamicObject instance that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the first DynamicObject instance that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the first DynamicObject instance that satisfies the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let youngestTeen = CoreStore.fetchOne(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne<B>(_ clauseChain: B) -> B.ObjectType? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the first DynamicObject instance that satisfies the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches all DynamicObject instances that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> [D]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    all DynamicObject instances that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches all DynamicObject instances that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> [D]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    all DynamicObject instances that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches all DynamicObject instances that satisfy the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let people = CoreStore.fetchAll(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll<B>(_ clauseChain: B) -> [B.ObjectType]? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    all DynamicObject instances that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the number of DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCount<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> Int? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the number DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the number of DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCount<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> Int? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the number DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the number of DynamicObjects that satisfy the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let numberOfAdults = CoreStore.fetchCount(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCount<B>(_ clauseChain: B) -> Int? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the number DynamicObjects that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> NSManagedObjectID? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> NSManagedObjectID? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let youngestTeenID = CoreStore.fetchObjectID(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchObjectID<B>(_ clauseChain: B) -> NSManagedObjectID? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> [NSManagedObjectID]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, fetches the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> [NSManagedObjectID]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let idsOfAdults = transaction.fetchObjectIDs(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchObjectIDs<B>(_ clauseChain: B) -> [NSManagedObjectID]? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + queryValue(_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, queries aggregate values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func queryValue<D, U>(_ from: From<D>, _ selectClause: Select<D, U>, _ queryClauses: QueryClause...) -> U? where D : DynamicObject, U : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • +
    + + + + queryValue(_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Using the defaultStack, queries aggregate values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func queryValue<D, U>(_ from: From<D>, _ selectClause: Select<D, U>, _ queryClauses: [QueryClause]) -> U? where D : DynamicObject, U : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • +
    + + + + queryValue(_:) + +
    +
    +
    +
    +
    +
    +

    Queries a property value or aggregate as specified by the QueryChainableBuilderType built from a chain of clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    +
    let averageAdultAge = CoreStore.queryValue(
    +    From<MyPersonEntity>()
    +        .select(Int.self, .average(\.age))
    +        .where(\.age > 18)
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func queryValue<B>(_ clauseChain: B) -> B.ResultType? where B : QueryChainableBuilderType, B.ResultType : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a QueryChainableBuilderType indicating the property/aggregate to fetch and the series of queries for the request.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query as specified by the QueryChainableBuilderType

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, queries a dictionary of attribute values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func queryAttributes<D>(_ from: From<D>, _ selectClause: Select<D, NSDictionary>, _ queryClauses: QueryClause...) -> [[String : Any]]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, queries a dictionary of attribute values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func queryAttributes<D>(_ from: From<D>, _ selectClause: Select<D, NSDictionary>, _ queryClauses: [QueryClause]) -> [[String : Any]]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • +
    + + + + queryAttributes(_:) + +
    +
    +
    +
    +
    +
    +

    Queries a dictionary of attribute values or as specified by the QueryChainableBuilderType built from a chain of clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    +
    let results = CoreStore.queryAttributes(
    +    From<MyPersonEntity>()
    +        .select(
    +            NSDictionary.self,
    +            .attribute(\.age, as: "age"),
    +            .count(\.age, as: "numberOfPeople")
    +        )
    +        .groupBy(\.age)
    +)
    +for dictionary in results! {
    +    let age = dictionary["age"] as! Int
    +    let count = dictionary["numberOfPeople"] as! Int
    +    print("There are \(count) people who are \(age) years old."
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func queryAttributes<B>(_ clauseChain: B) -> [[String : Any]]? where B : QueryChainableBuilderType, B.ResultType == NSDictionary
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a QueryChainableBuilderType indicating the properties to fetch and the series of queries for the request.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query as specified by the QueryChainableBuilderType

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + modelVersion + +
    +
    +
    +
    +
    +
    +

    Returns the defaultStack‘s model version. The version string is the same as the name of a version-specific .xcdatamodeld file or CoreStoreSchema.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static var modelVersion: String { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the entity name-to-class type mapping from the defaultStack‘s model.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func entityTypesByName(for type: NSManagedObject.Type) -> [EntityName : NSManagedObject.Type]
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the entity name-to-class type mapping from the defaultStack‘s model.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func entityTypesByName(for type: CoreStoreObject.Type) -> [EntityName : CoreStoreObject.Type]
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the NSEntityDescription for the specified NSManagedObject subclass from defaultStack‘s model.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func entityDescription(for type: NSManagedObject.Type) -> NSEntityDescription?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the NSEntityDescription for the specified CoreStoreObject subclass from defaultStack‘s model.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func entityDescription(for type: CoreStoreObject.Type) -> NSEntityDescription?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + addStorageAndWait() + +
    +
    +
    +
    +
    +
    +

    Creates an SQLiteStore with default parameters and adds it to the defaultStack. This method blocks until completion.

    +
    try CoreStore.addStorageAndWait()
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public static func addStorageAndWait() throws -> SQLiteStore
    + +
    +
    +
    +

    Return Value

    +

    the local SQLite storage added to the defaultStack

    +
    +
    +
    +
  • +
  • +
    + + + + addStorageAndWait(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a StorageInterface to the defaultStack and blocks until completion.

    +
    try CoreStore.addStorageAndWait(InMemoryStore(configuration: "Config1"))
    +
    +
    +

    Throws

    + a CoreStoreError value indicating the failure + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public static func addStorageAndWait<T>(_ storage: T) throws -> T where T : StorageInterface
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + storage + + + +
    +
    +
    +

    Return Value

    +

    the StorageInterface added to the defaultStack

    +
    +
    +
    +
  • +
  • +
    + + + + addStorageAndWait(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a LocalStorage to the defaultStack and blocks until completion.

    +
    try CoreStore.addStorageAndWait(SQLiteStore(configuration: "Config1"))
    +
    +
    +

    Throws

    + a CoreStoreError value indicating the failure + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public static func addStorageAndWait<T>(_ storage: T) throws -> T where T : LocalStorage
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + storage + + +
    +

    the local storage

    +
    +
    +
    +
    +

    Return Value

    +

    the local storage added to the defaultStack. Note that this may not always be the same instance as the parameter argument if a previous LocalStorage was already added at the same URL and with the same configuration.

    +
    +
    +
    +
  • +
  • +
    + + + + addStorageAndWait(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a CloudStorage to the defaultStack and blocks until completion.

    +
    guard let storage = ICloudStore(
    +    ubiquitousContentName: "MyAppCloudData",
    +    ubiquitousContentTransactionLogsSubdirectory: "logs/config1",
    +    ubiquitousContainerID: "iCloud.com.mycompany.myapp.containername",
    +    ubiquitousPeerToken: "9614d658014f4151a95d8048fb717cf0",
    +    configuration: "Config1",
    +    cloudStorageOptions: .recreateLocalStoreOnModelMismatch
    +) else {
    +    // iCloud is not available on the device
    +    return
    +}
    +try CoreStore.addStorageAndWait(storage)
    +
    +
    +

    Throws

    + a CoreStoreError value indicating the failure + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public static func addStorageAndWait<T>(_ storage: T) throws -> T where T : CloudStorage
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + storage + + +
    +

    the local storage

    +
    +
    +
    +
    +

    Return Value

    +

    the cloud storage added to the stack. Note that this may not always be the same instance as the parameter argument if a previous CloudStorage was already added at the same URL and with the same configuration.

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, performs a transaction asynchronously where NSManagedObject or CoreStoreObject creates, updates, and deletes can be made. The changes are commited automatically after the task closure returns. On success, the value returned from closure will be the wrapped as .success(userInfo: T) in the completion‘s Result<T>. Any errors thrown from inside the task will be reported as .failure(error: CoreStoreError). To cancel/rollback changes, call try transaction.cancel(), which throws a CoreStoreError.userCancelled.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func perform<T>(asynchronous task: @escaping (_ transaction: AsynchronousDataTransaction) throws -> T, completion: @escaping (AsynchronousDataTransaction.Result<T>) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + task + + +
    +

    the asynchronous closure where creates, updates, and deletes can be made to the transaction. Transaction blocks are executed serially in a background queue, and all changes are made from a concurrent NSManagedObjectContext.

    +
    +
    + + completion + + +
    +

    the closure executed after the save completes. The Result argument of the closure will either wrap the return value of task, or any uncaught errors thrown from within task. Cancelled tasks will be indicated by .failure(error: CoreStoreError.userCancelled). Custom errors thrown by the user will be wrapped in CoreStoreError.userError(error: Error).

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, performs a transaction asynchronously where NSManagedObject or CoreStoreObject creates, updates, and deletes can be made. The changes are commited automatically after the task closure returns. On success, the value returned from closure will be the argument of the success closure. Any errors thrown from inside the task will be wrapped in a CoreStoreError and reported in the failure closure. To cancel/rollback changes, call try transaction.cancel(), which throws a CoreStoreError.userCancelled.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func perform<T>(asynchronous task: @escaping (_ transaction: AsynchronousDataTransaction) throws -> T, success: @escaping (T) -> Void, failure: @escaping (CoreStoreError) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + task + + +
    +

    the asynchronous closure where creates, updates, and deletes can be made to the transaction. Transaction blocks are executed serially in a background queue, and all changes are made from a concurrent NSManagedObjectContext.

    +
    +
    + + success + + +
    +

    the closure executed after the save succeeds. The T argument of the closure will be the value returned from task.

    +
    +
    + + failure + + +
    +

    the closure executed if the save fails or if any errors are thrown within task. Cancelled tasks will be indicated by CoreStoreError.userCancelled. Custom errors thrown by the user will be wrapped in CoreStoreError.userError(error: Error).

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, performs a transaction synchronously where NSManagedObject or CoreStoreObject creates, updates, and deletes can be made. The changes are commited automatically after the task closure returns. On success, the value returned from closure will be the return value of perform(synchronous:). Any errors thrown from inside the task will be thrown from perform(synchronous:). To cancel/rollback changes, call try transaction.cancel(), which throws a CoreStoreError.userCancelled.

    +
    +

    Throws

    + a CoreStoreError value indicating the failure. Cancelled tasks will be indicated by CoreStoreError.userCancelled. Custom errors thrown by the user will be wrapped in CoreStoreError.userError(error: Error). + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func perform<T>(synchronous task: ((_ transaction: SynchronousDataTransaction) throws -> T), waitForAllObservers: Bool = true) throws -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + task + + +
    +

    the synchronous non-escaping closure where creates, updates, and deletes can be made to the transaction. Transaction blocks are executed serially in a background queue, and all changes are made from a concurrent NSManagedObjectContext.

    +
    +
    + + waitForAllObservers + + +
    +

    When true, this method waits for all observers to be notified of the changes before returning. This results in more predictable data update order, but may risk triggering deadlocks. When false, this method does not wait for observers to be notified of the changes before returning. This results in lower risk for deadlocks, but the updated data may not have been propagated to the DataStack after returning. Defaults to true.

    +
    +
    +
    +
    +

    Return Value

    +

    the value returned from task

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Using the defaultStack, begins a non-contiguous transaction where NSManagedObject or CoreStoreObject creates, updates, and deletes can be made. This is useful for making temporary changes, such as partially filled forms.

    + +
      +
    • prameter supportsUndo: undo(), redo(), and rollback() methods are only available when this parameter is true, otherwise those method will raise an exception. Defaults to false. Note that turning on Undo support may heavily impact performance especially on iOS or watchOS where memory is limited.
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func beginUnsafe(supportsUndo: Bool = false) -> UnsafeDataTransaction
    + +
    +
    +
    +

    Return Value

    +

    a UnsafeDataTransaction instance where creates, updates, and deletes can be made.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Refreshes all registered objects NSManagedObjects or CoreStoreObjects in the defaultStack.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func refreshAndMergeAllObjects()
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/CoreStoreError.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/CoreStoreError.html new file mode 100644 index 0000000..b74e0b8 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/CoreStoreError.html @@ -0,0 +1,1278 @@ + + + + CoreStoreError Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CoreStoreError

+
+
+
public enum CoreStoreError : Error, CustomNSError, Hashable
+ +
+
+

All errors thrown from CoreStore are expressed in CoreStoreError enum values.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + unknown + +
    +
    +
    +
    +
    +
    +

    A failure occured because of an unknown error.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case unknown
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The NSPersistentStore could not be initialized because another store existed at the specified NSURL.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case differentStorageExistsAtURL(existingPersistentStoreURL: URL)
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    An NSMappingModel could not be found for a specific source and destination model versions.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case mappingModelNotFound(localStoreURL: URL, targetModel: NSManagedObjectModel, targetModelVersion: String)
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Progressive migrations are disabled for a store, but an NSMappingModel could not be found for a specific source and destination model versions.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case progressiveMigrationRequired(localStoreURL: URL)
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The LocalStorage was configured with .allowSynchronousLightweightMigration, but the model can only be migrated asynchronously.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case asynchronousMigrationRequired(localStoreURL: URL, NSError: NSError)
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    An internal SDK call failed with the specified NSError.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case internalError(NSError: NSError)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + userError(error:) + +
    +
    +
    +
    +
    +
    +

    The transaction was terminated by a user-thrown Error.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case userError(error: Error)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + userCancelled + +
    +
    +
    +
    +
    +
    +

    The transaction was cancelled by the user.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case userCancelled
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + errorDomain + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static var errorDomain: String { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + errorCode + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var errorCode: Int { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + errorUserInfo + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var errorUserInfo: [String : Any] { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: CoreStoreError, rhs: CoreStoreError) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + bridgeToObjectiveC + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var bridgeToObjectiveC: CSError { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init?(_bridgedNSError error: NSError)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/CoreStoreErrorCode.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/CoreStoreErrorCode.html new file mode 100644 index 0000000..f3988d1 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/CoreStoreErrorCode.html @@ -0,0 +1,1004 @@ + + + + CoreStoreErrorCode Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CoreStoreErrorCode

+
+
+
public enum CoreStoreErrorCode : Int
+ +
+
+

The NSError error codes for CoreStoreErrorDomain.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + unknownError + +
    +
    +
    +
    +
    +
    +

    A failure occured because of an unknown error.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case unknownError
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The NSPersistentStore could note be initialized because another store existed at the specified NSURL.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case differentStorageExistsAtURL
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + mappingModelNotFound + +
    +
    +
    +
    +
    +
    +

    An NSMappingModel could not be found for a specific source and destination model versions.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case mappingModelNotFound
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Progressive migrations are disabled for a store, but an NSMappingModel could not be found for a specific source and destination model versions.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case progressiveMigrationRequired
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The LocalStorage was configured with .allowSynchronousLightweightMigration, but the model can only be migrated asynchronously.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case asynchronousMigrationRequired
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + internalError + +
    +
    +
    +
    +
    +
    +

    An internal SDK call failed with the specified NSError userInfo key.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case internalError
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + userError + +
    +
    +
    +
    +
    +
    +

    The transaction was terminated by a user-thrown Error specified by Error userInfo key.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case userError
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + userCancelled + +
    +
    +
    +
    +
    +
    +

    The transaction was cancelled by the user.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case userCancelled
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/MigrationResult.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/MigrationResult.html new file mode 100644 index 0000000..9840ad3 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/MigrationResult.html @@ -0,0 +1,953 @@ + + + + MigrationResult Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

MigrationResult

+
+
+
public enum MigrationResult : Hashable
+ +
+
+

The MigrationResult indicates the result of a migration. +The MigrationResult can be treated as a boolean:

+
CoreStore.upgradeStorageIfNeeded(SQLiteStorage(fileName: "data.sqlite")) { (result) in
+    switch result {
+    case .success(let migrationSteps):
+        // ...
+    case .failure(let error):
+        // ...
+    }
+}
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + success(_:) + +
    +
    +
    +
    +
    +
    +

    MigrationResult.success indicates either the migration succeeded, or there were no migrations needed. The associated value is an array of MigrationTypes reflecting the migration steps completed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case success([MigrationType])
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + failure(_:) + +
    +
    +
    +
    +
    +
    +

    SaveResult.failure indicates that the migration failed. The associated object for this value is the a CoreStoreError enum value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case failure(CoreStoreError)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + isSuccess + +
    +
    +
    +
    +
    +
    +

    Returns true if the result indicates .success, false if the result is .failure.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isSuccess: Bool { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/MigrationType.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/MigrationType.html new file mode 100644 index 0000000..562ea1a --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/MigrationType.html @@ -0,0 +1,1152 @@ + + + + MigrationType Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

MigrationType

+
+
+
public enum MigrationType : Hashable
+ +
+
+

The MigrationType specifies the type of migration required for a store.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + none(version:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the persistent store matches the latest model version and no migration is needed

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case none(version: ModelVersion)
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Indicates that the persistent store does not match the latest model version but Core Data can infer the mapping model, so a lightweight migration is needed

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case lightweight(sourceVersion: ModelVersion, destinationVersion: ModelVersion)
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Indicates that the persistent store does not match the latest model version and Core Data could not infer a mapping model, so a custom migration is needed

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case heavyweight(sourceVersion: ModelVersion, destinationVersion: ModelVersion)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + sourceVersion + +
    +
    +
    +
    +
    +
    +

    Returns the source model version for the migration type. If no migration is required, sourceVersion will be equal to the destinationVersion.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var sourceVersion: ModelVersion { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + destinationVersion + +
    +
    +
    +
    +
    +
    +

    Returns the destination model version for the migration type. If no migration is required, destinationVersion will be equal to the sourceVersion.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var destinationVersion: ModelVersion { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns true if the MigrationType is a lightweight migration. Used as syntactic sugar.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isLightweightMigration: Bool { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns true if the MigrationType is a heavyweight migration. Used as syntactic sugar.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isHeavyweightMigration: Bool { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + hasMigration + +
    +
    +
    +
    +
    +
    +

    Returns true if the MigrationType is either a lightweight or a heavyweight migration. Returns false if no migrations specified.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var hasMigration: Bool { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: MigrationType, rhs: MigrationType) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/RelationshipContainer.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/RelationshipContainer.html new file mode 100644 index 0000000..8483587 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/RelationshipContainer.html @@ -0,0 +1,944 @@ + + + + RelationshipContainer Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

RelationshipContainer

+
+
+
public enum RelationshipContainer<O> where O : CoreStoreObject
+ +
+
+

The containing type for relationships. Use the DynamicObject.Relationship typealias instead for shorter syntax.

+
class Dog: CoreStoreObject {
+    let master = Relationship.ToOne<Person>("master")
+}
+class Person: CoreStoreObject {
+    let pets = Relationship.ToManyUnordered<Dog>("pets", inverse: { $0.master })
+}
+
+ +
+
+ +
+
+
+
+ + + +

ToOne

+
+
+
    +
  • +
    + + + + ToOne + +
    +
    +
    +
    +
    +
    +

    The containing type for to-one relationships. Any CoreStoreObject subclass can be a destination type. Inverse relationships should be declared from the destination type as well, using the inverse: argument for the relationship.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyUnordered<Dog>("pets", inverse: { $0.master })
    +}
    +
    +
    +

    Important

    + Relationship.ToOne properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class ToOne<D> : RelationshipProtocol where D : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ToManyOrdered + +
    +
    +
    +
    +
    +
    +

    The containing type for to-many ordered relationships. Any CoreStoreObject subclass can be a destination type. Inverse relationships should be declared from the destination type as well, using the inverse: argument for the relationship.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyOrdered<Dog>("pets", inverse: { $0.master })
    +}
    +
    +
    +

    Important

    + Relationship.ToManyOrdered properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class ToManyOrdered<D> : RelationshipProtocol where D : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ToManyUnordered + +
    +
    +
    +
    +
    +
    +

    The containing type for to-many unordered relationships. Any CoreStoreObject subclass can be a destination type. Inverse relationships should be declared from the destination type as well, using the inverse: argument for the relationship.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyUnordered<Dog>("pets", inverse: { $0.master })
    +}
    +
    +
    +

    Important

    + Relationship.ToManyUnordered properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class ToManyUnordered<D> : RelationshipProtocol where D : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/RelationshipContainer/ToManyOrdered.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/RelationshipContainer/ToManyOrdered.html new file mode 100644 index 0000000..1cd1cf1 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/RelationshipContainer/ToManyOrdered.html @@ -0,0 +1,1920 @@ + + + + ToManyOrdered Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ToManyOrdered

+
+
+
public final class ToManyOrdered<D> : RelationshipProtocol where D : CoreStoreObject
+ +
+
+

The containing type for to-many ordered relationships. Any CoreStoreObject subclass can be a destination type. Inverse relationships should be declared from the destination type as well, using the inverse: argument for the relationship.

+
class Dog: CoreStoreObject {
+    let master = Relationship.ToOne<Person>("master")
+}
+class Person: CoreStoreObject {
+    let pets = Relationship.ToManyOrdered<Dog>("pets", inverse: { $0.master })
+}
+
+
+

Important

+ Relationship.ToManyOrdered properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the relationship. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object. Make sure to declare this relationship’s inverse relationship on its destination object. Due to Swift’s compiler limitation, only one of the relationship and its inverse can declare an inverse: argument.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyOrdered<Dog>("pets", inverse: { $0.master })
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(
    +    _ keyPath: KeyPathString,
    +    minCount: Int = 0,
    +    maxCount: Int = 0,
    +    deleteRule: DeleteRule = .nullify,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent name for this relationship.

    +
    +
    + + minCount + + +
    +

    the minimum number of objects in this relationship UNLESS THE RELATIONSHIP IS EMPTY. This means there might be zero objects in the relationship, which might be less than minCount. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + maxCount + + +
    +

    the maximum number of objects in this relationship. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + deleteRule + + +
    +

    defines what happens to relationship when an object is deleted. Valid values are .nullify, .cascade, and .delete. Defaults to .nullify.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a relationship as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the relationship. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object. Make sure to declare this relationship’s inverse relationship on its destination object. Due to Swift’s compiler limitation, only one of the relationship and its inverse can declare an inverse: argument.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyOrdered<Dog>("pets", inverse: { $0.master })
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(
    +    _ keyPath: KeyPathString,
    +    minCount: Int = 0,
    +    maxCount: Int = 0,
    +    inverse: @escaping (D) -> RelationshipContainer<D>.ToOne<O>,
    +    deleteRule: DeleteRule = .nullify,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent name for this relationship.

    +
    +
    + + minCount + + +
    +

    the minimum number of objects in this relationship UNLESS THE RELATIONSHIP IS EMPTY. This means there might be zero objects in the relationship, which might be less than minCount. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + maxCount + + +
    +

    the maximum number of objects in this relationship. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + inverse + + +
    +

    the inverse relationship that is declared for the destination object. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object.

    +
    +
    + + deleteRule + + +
    +

    defines what happens to relationship when an object is deleted. Valid values are .nullify, .cascade, and .delete. Defaults to .nullify.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a relationship as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the relationship. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object. Make sure to declare this relationship’s inverse relationship on its destination object. Due to Swift’s compiler limitation, only one of the relationship and its inverse can declare an inverse: argument.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyOrdered<Dog>("pets", inverse: { $0.master })
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(
    +    _ keyPath: KeyPathString,
    +    minCount: Int = 0,
    +    maxCount: Int = 0,
    +    inverse: @escaping (D) -> RelationshipContainer<D>.ToManyOrdered<O>,
    +    deleteRule: DeleteRule = .nullify,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent name for this relationship.

    +
    +
    + + minCount + + +
    +

    the minimum number of objects in this relationship UNLESS THE RELATIONSHIP IS EMPTY. This means there might be zero objects in the relationship, which might be less than minCount. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + maxCount + + +
    +

    the maximum number of objects in this relationship. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + inverse + + +
    +

    the inverse relationship that is declared for the destination object. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object.

    +
    +
    + + deleteRule + + +
    +

    defines what happens to relationship when an object is deleted. Valid values are .nullify, .cascade, and .delete. Defaults to .nullify.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a relationship as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the relationship. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object. Make sure to declare this relationship’s inverse relationship on its destination object. Due to Swift’s compiler limitation, only one of the relationship and its inverse can declare an inverse: argument.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyOrdered<Dog>("pets", inverse: { $0.master })
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(
    +    _ keyPath: KeyPathString,
    +    minCount: Int = 0,
    +    maxCount: Int = 0,
    +    inverse: @escaping (D) -> RelationshipContainer<D>.ToManyUnordered<O>,
    +    deleteRule: DeleteRule = .nullify,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent name for this relationship.

    +
    +
    + + minCount + + +
    +

    the minimum number of objects in this relationship UNLESS THE RELATIONSHIP IS EMPTY. This means there might be zero objects in the relationship, which might be less than minCount. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + maxCount + + +
    +

    the maximum number of objects in this relationship. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + inverse + + +
    +

    the inverse relationship that is declared for the destination object. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object.

    +
    +
    + + deleteRule + + +
    +

    defines what happens to relationship when an object is deleted. Valid values are .nullify, .cascade, and .delete. Defaults to .nullify.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a relationship as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + value + +
    +
    +
    +
    +
    +
    +

    The relationship ordered objects.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var value: [D] { get set }
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = O
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ValueType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ValueType = D
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_keyPathString + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var cs_keyPathString: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + Iterator + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Iterator = AnyIterator<D>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + makeIterator() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func makeIterator() -> Iterator
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + Index + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Index = Int
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + startIndex + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var startIndex: Index { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + endIndex + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var endIndex: Index { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(position: Index) -> Iterator.Element { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + index(after:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func index(after i: Index) -> Index
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns a sequence of objects to the relationship. The operation

    +
    person.pets .= [dog, cat]
    +
    + +

    is equivalent to

    +
    person.pets.value = [dog, cat]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= <S>(relationship: RelationshipContainer<O>.ToManyOrdered<D>, newValue: S) where D == S.Element, S : Sequence
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns a sequence of objects to the relationship. The operation

    +
    person.pets .= anotherPerson.pets
    +
    + +

    is equivalent to

    +
    person.pets.value = anotherPerson.pets.value
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= <O2>(relationship: RelationshipContainer<O>.ToManyOrdered<D>, relationship2: RelationshipContainer<O2>.ToManyOrdered<D>) where O2 : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares equality between a relationship’s objects and a collection of objects

    +
    if person.pets .== [dog, cat] { ... }
    +
    + +

    is equivalent to

    +
    if person.pets.value == [dog, cat] { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== <C>(relationship: RelationshipContainer<O>.ToManyOrdered<D>, collection: C) -> Bool where D == C.Element, C : Collection
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares equality between a collection of objects and a relationship’s objects

    +
    if [dog, cat] .== person.pets { ... }
    +
    + +

    is equivalent to

    +
    if [dog, cat] == person.pets.value { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== <C>(collection: C, relationship: RelationshipContainer<O>.ToManyOrdered<D>) -> Bool where D == C.Element, C : Collection
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares equality between a relationship’s objects and a collection of objects

    +
    if person.pets .== anotherPerson.pets { ... }
    +
    + +

    is equivalent to

    +
    if person.pets.value == anotherPerson.pets.value { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== <O2>(relationship: RelationshipContainer<O>.ToManyOrdered<D>, relationship2: RelationshipContainer<O2>.ToManyOrdered<D>) -> Bool where O2 : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/RelationshipContainer/ToManyUnordered.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/RelationshipContainer/ToManyUnordered.html new file mode 100644 index 0000000..6461fcf --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/RelationshipContainer/ToManyUnordered.html @@ -0,0 +1,1889 @@ + + + + ToManyUnordered Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ToManyUnordered

+
+
+
public final class ToManyUnordered<D> : RelationshipProtocol where D : CoreStoreObject
+ +
+
+

The containing type for to-many unordered relationships. Any CoreStoreObject subclass can be a destination type. Inverse relationships should be declared from the destination type as well, using the inverse: argument for the relationship.

+
class Dog: CoreStoreObject {
+    let master = Relationship.ToOne<Person>("master")
+}
+class Person: CoreStoreObject {
+    let pets = Relationship.ToManyUnordered<Dog>("pets", inverse: { $0.master })
+}
+
+
+

Important

+ Relationship.ToManyUnordered properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the relationship. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object. Make sure to declare this relationship’s inverse relationship on its destination object. Due to Swift’s compiler limitation, only one of the relationship and its inverse can declare an inverse: argument.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyOrdered<Dog>("pets", inverse: { $0.master })
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(
    +    _ keyPath: KeyPathString,
    +    deleteRule: DeleteRule = .nullify,
    +    minCount: Int = 0,
    +    maxCount: Int = 0,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent name for this relationship.

    +
    +
    + + minCount + + +
    +

    the minimum number of objects in this relationship UNLESS THE RELATIONSHIP IS EMPTY. This means there might be zero objects in the relationship, which might be less than minCount. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + maxCount + + +
    +

    the maximum number of objects in this relationship. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + inverse + + +
    +

    the inverse relationship that is declared for the destination object. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object.

    +
    +
    + + deleteRule + + +
    +

    defines what happens to relationship when an object is deleted. Valid values are .nullify, .cascade, and .delete. Defaults to .nullify.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a relationship as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the relationship. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object. Make sure to declare this relationship’s inverse relationship on its destination object. Due to Swift’s compiler limitation, only one of the relationship and its inverse can declare an inverse: argument.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyOrdered<Dog>("pets", inverse: { $0.master })
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(
    +    _ keyPath: KeyPathString,
    +    inverse: @escaping (D) -> RelationshipContainer<D>.ToOne<O>,
    +    deleteRule: DeleteRule = .nullify,
    +    minCount: Int = 0,
    +    maxCount: Int = 0,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent name for this relationship.

    +
    +
    + + minCount + + +
    +

    the minimum number of objects in this relationship UNLESS THE RELATIONSHIP IS EMPTY. This means there might be zero objects in the relationship, which might be less than minCount. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + maxCount + + +
    +

    the maximum number of objects in this relationship. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + inverse + + +
    +

    the inverse relationship that is declared for the destination object. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object.

    +
    +
    + + deleteRule + + +
    +

    defines what happens to relationship when an object is deleted. Valid values are .nullify, .cascade, and .delete. Defaults to .nullify.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a relationship as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the relationship. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object. Make sure to declare this relationship’s inverse relationship on its destination object. Due to Swift’s compiler limitation, only one of the relationship and its inverse can declare an inverse: argument.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyOrdered<Dog>("pets", inverse: { $0.master })
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(
    +    _ keyPath: KeyPathString,
    +    inverse: @escaping (D) -> RelationshipContainer<D>.ToManyOrdered<O>,
    +    deleteRule: DeleteRule = .nullify,
    +    minCount: Int = 0,
    +    maxCount: Int = 0,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent name for this relationship.

    +
    +
    + + minCount + + +
    +

    the minimum number of objects in this relationship UNLESS THE RELATIONSHIP IS EMPTY. This means there might be zero objects in the relationship, which might be less than minCount. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + maxCount + + +
    +

    the maximum number of objects in this relationship. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + inverse + + +
    +

    the inverse relationship that is declared for the destination object. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object.

    +
    +
    + + deleteRule + + +
    +

    defines what happens to relationship when an object is deleted. Valid values are .nullify, .cascade, and .delete. Defaults to .nullify.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a relationship as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the relationship. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object. Make sure to declare this relationship’s inverse relationship on its destination object. Due to Swift’s compiler limitation, only one of the relationship and its inverse can declare an inverse: argument.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyOrdered<Dog>("pets", inverse: { $0.master })
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(
    +    _ keyPath: KeyPathString,
    +    inverse: @escaping (D) -> RelationshipContainer<D>.ToManyUnordered<O>,
    +    deleteRule: DeleteRule = .nullify,
    +    minCount: Int = 0,
    +    maxCount: Int = 0,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent name for this relationship.

    +
    +
    + + minCount + + +
    +

    the minimum number of objects in this relationship UNLESS THE RELATIONSHIP IS EMPTY. This means there might be zero objects in the relationship, which might be less than minCount. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + maxCount + + +
    +

    the maximum number of objects in this relationship. If the number of objects in the relationship do not satisfy minCount and maxCount, the transaction’s commit (or auto-commit) would fail with a validation error.

    +
    +
    + + inverse + + +
    +

    the inverse relationship that is declared for the destination object. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object.

    +
    +
    + + deleteRule + + +
    +

    defines what happens to relationship when an object is deleted. Valid values are .nullify, .cascade, and .delete. Defaults to .nullify.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a relationship as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + value + +
    +
    +
    +
    +
    +
    +

    The relationship unordered objects.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var value: Set<D> { get set }
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = O
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ValueType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ValueType = D
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_keyPathString + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var cs_keyPathString: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + count + +
    +
    +
    +
    +
    +
    +

    The number of elements in the set.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var count: Int { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + isEmpty + +
    +
    +
    +
    +
    +
    +

    A Boolean value indicating whether the range contains no elements.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isEmpty: Bool { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + Iterator + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Iterator = AnyIterator<D>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + makeIterator() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func makeIterator() -> Iterator
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns a sequence of objects to the relationship. The operation

    +
    person.pets .= [dog, cat]
    +
    + +

    is equivalent to

    +
    person.pets.value = [dog, cat]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= <S>(relationship: RelationshipContainer<O>.ToManyUnordered<D>, newValue: S) where D == S.Element, S : Sequence
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns a sequence of objects to the relationship. The operation

    +
    person.pets .= anotherPerson.pets
    +
    + +

    is equivalent to

    +
    person.pets.value = anotherPerson.pets.value
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= <O2>(relationship: RelationshipContainer<O>.ToManyUnordered<D>, relationship2: RelationshipContainer<O2>.ToManyUnordered<D>) where O2 : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns a sequence of objects to the relationship. The operation

    +
    person.pets .= anotherPerson.pets
    +
    + +

    is equivalent to

    +
    person.pets.value = anotherPerson.pets.value
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= <O2>(relationship: RelationshipContainer<O>.ToManyUnordered<D>, relationship2: RelationshipContainer<O2>.ToManyOrdered<D>) where O2 : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares the if the relationship’s objects and a set of objects have the same elements.

    +
    if person.pets .== Set<Animal>([dog, cat]) { ... }
    +
    + +

    is equivalent to

    +
    if person.pets.value == Set<Animal>([dog, cat]) { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== (relationship: RelationshipContainer<O>.ToManyUnordered<D>, set: Set<D>) -> Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares if a set of objects and a relationship’s objects have the same elements.

    +
    if Set<Animal>([dog, cat]) .== person.pets { ... }
    +
    + +

    is equivalent to

    +
    if Set<Animal>([dog, cat]) == person.pets.value { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== (set: Set<D>, relationship: RelationshipContainer<O>.ToManyUnordered<D>) -> Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares if a relationship’s objects and another relationship’s objects have the same elements.

    +
    if person.pets .== anotherPerson.pets { ... }
    +
    + +

    is equivalent to

    +
    if person.pets.value == anotherPerson.pets.value { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== <O2>(relationship: RelationshipContainer<O>.ToManyUnordered<D>, relationship2: RelationshipContainer<O2>.ToManyUnordered<D>) -> Bool where O2 : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/RelationshipContainer/ToOne.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/RelationshipContainer/ToOne.html new file mode 100644 index 0000000..8a4ff82 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/RelationshipContainer/ToOne.html @@ -0,0 +1,1710 @@ + + + + ToOne Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ToOne

+
+
+
public final class ToOne<D> : RelationshipProtocol where D : CoreStoreObject
+ +
+
+

The containing type for to-one relationships. Any CoreStoreObject subclass can be a destination type. Inverse relationships should be declared from the destination type as well, using the inverse: argument for the relationship.

+
class Dog: CoreStoreObject {
+    let master = Relationship.ToOne<Person>("master")
+}
+class Person: CoreStoreObject {
+    let pets = Relationship.ToManyUnordered<Dog>("pets", inverse: { $0.master })
+}
+
+
+

Important

+ Relationship.ToOne properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the relationship. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object. Make sure to declare this relationship’s inverse relationship on its destination object. Due to Swift’s compiler limitation, only one of the relationship and its inverse can declare an inverse: argument.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyUnordered<Dog>("pets", inverse: { $0.master })
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(
    +    _ keyPath: KeyPathString,
    +    deleteRule: DeleteRule = .nullify,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent name for this relationship.

    +
    +
    + + deleteRule + + +
    +

    defines what happens to relationship when an object is deleted. Valid values are .nullify, .cascade, and .delete. Defaults to .nullify.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a relationship as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the relationship. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object. Make sure to declare this relationship’s inverse relationship on its destination object. Due to Swift’s compiler limitation, only one of the relationship and its inverse can declare an inverse: argument.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyUnordered<Dog>("pets", inverse: { $0.master })
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(
    +    _ keyPath: KeyPathString,
    +    inverse: @escaping (D) -> RelationshipContainer<D>.ToOne<O>,
    +    deleteRule: DeleteRule = .nullify,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent name for this relationship.

    +
    +
    + + inverse + + +
    +

    the inverse relationship that is declared for the destination object. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object.

    +
    +
    + + deleteRule + + +
    +

    defines what happens to relationship when an object is deleted. Valid values are .nullify, .cascade, and .delete. Defaults to .nullify.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a relationship as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the relationship. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object. Make sure to declare this relationship’s inverse relationship on its destination object. Due to Swift’s compiler limitation, only one of the relationship and its inverse can declare an inverse: argument.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyUnordered<Dog>("pets", inverse: { $0.master })
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(
    +    _ keyPath: KeyPathString,
    +    inverse: @escaping (D) -> RelationshipContainer<D>.ToManyOrdered<O>,
    +    deleteRule: DeleteRule = .nullify,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent name for this relationship.

    +
    +
    + + inverse + + +
    +

    the inverse relationship that is declared for the destination object. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object.

    +
    +
    + + deleteRule + + +
    +

    defines what happens to relationship when an object is deleted. Valid values are .nullify, .cascade, and .delete. Defaults to .nullify.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a relationship as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the relationship. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object. Make sure to declare this relationship’s inverse relationship on its destination object. Due to Swift’s compiler limitation, only one of the relationship and its inverse can declare an inverse: argument.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyUnordered<Dog>("pets", inverse: { $0.master })
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(
    +    _ keyPath: KeyPathString,
    +    inverse: @escaping (D) -> RelationshipContainer<D>.ToManyUnordered<O>,
    +    deleteRule: DeleteRule = .nullify,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent name for this relationship.

    +
    +
    + + inverse + + +
    +

    the inverse relationship that is declared for the destination object. All relationships require an inverse, so updates to to this object’s relationship are also reflected on its destination object.

    +
    +
    + + deleteRule + + +
    +

    defines what happens to relationship when an object is deleted. Valid values are .nullify, .cascade, and .delete. Defaults to .nullify.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a relationship as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + value + +
    +
    +
    +
    +
    +
    +

    The relationship destination object.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var value: D? { get set }
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is equal to a value

    +
    let dog = CoreStore.fetchOne(From<Dog>().where({ $0.master == me }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (relationship: RelationshipContainer<O>.ToOne<D>, object: D?) -> Where<O>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is not equal to a value

    +
    let dog = CoreStore.fetchOne(From<Dog>().where({ $0.master != me }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func != (relationship: RelationshipContainer<O>.ToOne<D>, object: D?) -> Where<O>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ~=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by checking if a sequence contains the value of a property

    +
    let dog = CoreStore.fetchOne(From<Dog>().where({ [john, joe, bob] ~= $0.master }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ~= <S>(sequence: S, relationship: RelationshipContainer<O>.ToOne<D>) -> Where<O> where D == S.Element, S : Sequence
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = O
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ValueType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ValueType = D
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_keyPathString + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var cs_keyPathString: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns an object to the relationship. The operation

    +
    dog.master .= person
    +
    + +

    is equivalent to

    +
    dog.master.value = person
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= (relationship: RelationshipContainer<O>.ToOne<D>, newObject: D?)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns an object from another relationship. The operation

    +
    dog.master .= anotherDog.master
    +
    + +

    is equivalent to

    +
    dog.master.value = anotherDog.master.value
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= <O2>(relationship: RelationshipContainer<O>.ToOne<D>, relationship2: RelationshipContainer<O2>.ToOne<D>) where O2 : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares equality between a relationship’s object and another object

    +
    if dog.master .== person { ... }
    +
    + +

    is equivalent to

    +
    if dog.master.value == person { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== (relationship: RelationshipContainer<O>.ToOne<D>, object: D?) -> Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares equality between an object and a relationship’s object

    +
    if dog.master .== person { ... }
    +
    + +

    is equivalent to

    +
    if dog.master.value == person { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== (object: D?, relationship: RelationshipContainer<O>.ToOne<D>) -> Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares equality between a relationship’s object and another relationship’s object

    +
    if dog.master .== person { ... }
    +
    + +

    is equivalent to

    +
    if dog.master.value == person { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== <O2>(relationship: RelationshipContainer<O>.ToOne<D>, relationship2: RelationshipContainer<O2>.ToOne<D>) -> Bool where O2 : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/SelectTerm.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/SelectTerm.html new file mode 100644 index 0000000..f666536 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/SelectTerm.html @@ -0,0 +1,3285 @@ + + + + SelectTerm Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SelectTerm

+
+
+
public enum SelectTerm<D> : ExpressibleByStringLiteral, Hashable where D : DynamicObject
+ +
+
+

The SelectTerm is passed to the Select clause to indicate the attributes/aggregate keys to be queried.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + attribute(_:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying an entity attribute. A shorter way to do the same is to assign from the string keypath directly:

    +
    let fullName = CoreStore.queryValue(
    +    From<MyPersonEntity>(),
    +    Select<String>(.attribute("fullName")),
    +    Where("employeeID", isEqualTo: 1111)
    +)
    +
    + +

    is equivalent to:

    +
    let fullName = CoreStore.queryValue(
    +    From<MyPersonEntity>(),
    +    Select<String>("fullName"),
    +    Where("employeeID", isEqualTo: 1111)
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func attribute(_ keyPath: KeyPathString) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying an entity attribute

    +
    +
    +
    +
  • +
  • +
    + + + + average(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the average value of an attribute.

    +
    let averageAge = CoreStore.queryValue(
    +    From<MyPersonEntity>(),
    +    Select<Int>(.average("age"))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func average(_ keyPath: KeyPathString, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key average() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the average value of an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + count(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for a count query.

    +
    let numberOfEmployees = CoreStore.queryValue(
    +    From<MyPersonEntity>(),
    +    Select<Int>(.count("employeeID"))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func count(_ keyPath: KeyPathString, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key count() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for a count query

    +
    +
    +
    +
  • +
  • +
    + + + + maximum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the maximum value for an attribute.

    +
    let maximumAge = CoreStore.queryValue(
    +    From<MyPersonEntity>(),
    +    Select<Int>(.maximum("age"))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func maximum(_ keyPath: KeyPathString, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key max() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the maximum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + minimum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the minimum value for an attribute.

    +
    let minimumAge = CoreStore.queryValue(
    +    From<MyPersonEntity>(),
    +    Select<Int>(.minimum("age"))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func minimum(_ keyPath: KeyPathString, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key min() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the minimum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + sum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the sum value for an attribute.

    +
    let totalAge = CoreStore.queryValue(
    +    From<MyPersonEntity>(),
    +    Select<Int>(.sum("age"))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func sum(_ keyPath: KeyPathString, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key sum() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the sum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + objectID(as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the NSManagedObjectID.

    +
    let objectID = CoreStore.queryValue(
    +    From<MyPersonEntity>(),
    +    Select<NSManagedObjectID>(),
    +    Where("employeeID", isEqualTo: 1111)
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func objectID(as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key objecID is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the sum value for an attribute

    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: SelectTerm<D>, rhs: SelectTerm<D>) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + attribute(_:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying an entity attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func attribute<V>(_ keyPath: KeyPath<D, V>) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying an entity attribute

    +
    +
    +
    +
  • +
  • +
    + + + + average(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the average value of an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func average<V>(_ keyPath: KeyPath<D, V>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key average() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the average value of an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + count(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for a count query.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func count<V>(_ keyPath: KeyPath<D, V>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key count() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for a count query

    +
    +
    +
    +
  • +
  • +
    + + + + maximum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the maximum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func maximum<V>(_ keyPath: KeyPath<D, V>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key max() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the maximum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + minimum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the minimum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func minimum<V>(_ keyPath: KeyPath<D, V>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key min() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the minimum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + sum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the sum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func sum<V>(_ keyPath: KeyPath<D, V>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key sum() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the sum value for an attribute

    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + attribute(_:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying an entity attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func attribute<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Required<V>>) -> SelectTerm<D> where V : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying an entity attribute

    +
    +
    +
    +
  • +
  • +
    + + + + attribute(_:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying an entity attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func attribute<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<V>>) -> SelectTerm<D> where V : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying an entity attribute

    +
    +
    +
    +
  • +
  • +
    + + + + attribute(_:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying an entity attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func attribute<V>(_ keyPath: KeyPath<D, TransformableContainer<D>.Required<V>>) -> SelectTerm<D> where V : NSCoding, V : NSCopying
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying an entity attribute

    +
    +
    +
    +
  • +
  • +
    + + + + attribute(_:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying an entity attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func attribute<V>(_ keyPath: KeyPath<D, TransformableContainer<D>.Optional<V>>) -> SelectTerm<D> where V : NSCoding, V : NSCopying
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying an entity attribute

    +
    +
    +
    +
  • +
  • +
    + + + + average(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the average value of an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func average<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key average() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the average value of an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + average(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the average value of an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func average<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key average() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the average value of an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + average(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the average value of an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func average<V>(_ keyPath: KeyPath<D, TransformableContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key average() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the average value of an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + average(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the average value of an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func average<V>(_ keyPath: KeyPath<D, TransformableContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key average() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the average value of an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + count(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for a count query.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func count<V>(_ keyPath: KeyPath<D,
    +    ValueContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key count() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for a count query

    +
    +
    +
    +
  • +
  • +
    + + + + count(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for a count query.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func count<V>(_ keyPath: KeyPath<D,
    +    ValueContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key count() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for a count query

    +
    +
    +
    +
  • +
  • +
    + + + + count(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for a count query.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func count<V>(_ keyPath: KeyPath<D,
    +    TransformableContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key count() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for a count query

    +
    +
    +
    +
  • +
  • +
    + + + + count(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for a count query.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func count<V>(_ keyPath: KeyPath<D,
    +    TransformableContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key count() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for a count query

    +
    +
    +
    +
  • +
  • +
    + + + + maximum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the maximum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func maximum<V>(_ keyPath: KeyPath<D,
    +    ValueContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key max() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the maximum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + maximum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the maximum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func maximum<V>(_ keyPath: KeyPath<D,
    +    ValueContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key max() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the maximum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + maximum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the maximum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func maximum<V>(_ keyPath: KeyPath<D,
    +    TransformableContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key max() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the maximum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + maximum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the maximum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func maximum<V>(_ keyPath: KeyPath<D,
    +    TransformableContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key max() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the maximum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + minimum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the minimum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func minimum<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key min() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the minimum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + minimum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the minimum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func minimum<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key min() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the minimum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + minimum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the minimum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func minimum<V>(_ keyPath: KeyPath<D, TransformableContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key min() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the minimum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + minimum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the minimum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func minimum<V>(_ keyPath: KeyPath<D, TransformableContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key min() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the minimum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + sum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the sum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func sum<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key sum() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the sum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + sum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the sum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func sum<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key sum() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the sum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + sum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the sum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func sum<V>(_ keyPath: KeyPath<D, TransformableContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key sum() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the sum value for an attribute

    +
    +
    +
    +
  • +
  • +
    + + + + sum(_:as:) + +
    +
    +
    +
    +
    +
    +

    Provides a SelectTerm to a Select clause for querying the sum value for an attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func sum<V>(_ keyPath: KeyPath<D, TransformableContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the attribute name

    +
    +
    + + alias + + +
    +

    the dictionary key to use to access the result. Ignored when the query return value is not an NSDictionary. If nil, the default key sum() is used

    +
    +
    +
    +
    +

    Return Value

    +

    a SelectTerm to a Select clause for querying the sum value for an attribute

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/SetupResult.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/SetupResult.html new file mode 100644 index 0000000..aa66631 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/SetupResult.html @@ -0,0 +1,1007 @@ + + + + SetupResult Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SetupResult

+
+
+
public enum SetupResult<T> : Hashable where T : StorageInterface
+ +
+
+

The SetupResult indicates the result of an asynchronous initialization of a persistent store. +The SetupResult can be treated as a boolean:

+
try! CoreStore.addStorage(
+    SQLiteStore(),
+    completion: { (result: SetupResult) -> Void in
+        if result {
+            // succeeded
+        }
+        else {
+            // failed
+        }
+    }
+)
+
+ +

or as an enum, where the resulting associated object can also be inspected:

+
try! CoreStore.addStorage(
+    SQLiteStore(),
+    completion: { (result: SetupResult) -> Void in
+        switch result {
+        case .success(let storage):
+            // storage is the related StorageInterface instance
+        case .failure(let error):
+            // error is the CoreStoreError enum value for the failure
+        }
+    }
+)
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + success(_:) + +
    +
    +
    +
    +
    +
    +

    SetupResult.success indicates that the storage setup succeeded. The associated object for this enum value is the related StorageInterface instance.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case success(T)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + failure(_:) + +
    +
    +
    +
    +
    +
    +

    SetupResult.failure indicates that the storage setup failed. The associated object for this value is the related CoreStoreError enum value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case failure(CoreStoreError)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + isSuccess + +
    +
    +
    +
    +
    +
    +

    Returns true if the result indicates .success, false if the result is .failure.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isSuccess: Bool { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == <T, U>(lhs: SetupResult<T>, rhs: SetupResult<U>) -> Bool where T : StorageInterface, U : StorageInterface
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/TransformableContainer.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/TransformableContainer.html new file mode 100644 index 0000000..3e5dbee --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/TransformableContainer.html @@ -0,0 +1,890 @@ + + + + TransformableContainer Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

TransformableContainer

+
+
+
public enum TransformableContainer<O> where O : CoreStoreObject
+ +
+
+

The containing type for transformable properties. Use the DynamicObject.Transformable typealias instead for shorter syntax.

+
class Animal: CoreStoreObject {
+    let species = Value.Required<String>("species", initial: "")
+    let nickname = Value.Optional<String>("nickname")
+    let color = Transformable.Optional<UIColor>("color")
+}
+
+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + Required + +
    +
    +
    +
    +
    +
    +

    The containing type for transformable properties. Any type that conforms to NSCoding & NSCopying are supported.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let nickname = Value.Optional<String>("nickname")
    +    let color = Transformable.Optional<UIColor>("color")
    +}
    +
    +
    +

    Important

    + Transformable.Required properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class Required<V> : AttributeProtocol where V : NSCoding, V : NSCopying
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + Optional + +
    +
    +
    +
    +
    +
    +

    The containing type for optional transformable properties. Any type that conforms to NSCoding & NSCopying are supported.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let nickname = Value.Optional<String>("nickname")
    +    let color = Transformable.Optional<UIColor>("color")
    +}
    +
    +
    +

    Important

    + Transformable.Optional properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class Optional<V> : AttributeProtocol where V : NSCoding, V : NSCopying
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/TransformableContainer/Optional.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/TransformableContainer/Optional.html new file mode 100644 index 0000000..0612861 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/TransformableContainer/Optional.html @@ -0,0 +1,1257 @@ + + + + Optional Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Optional

+
+
+
public final class Optional<V> : AttributeProtocol where V : NSCoding, V : NSCopying
+ +
+
+

The containing type for optional transformable properties. Any type that conforms to NSCoding & NSCopying are supported.

+
class Animal: CoreStoreObject {
+    let species = Value.Required<String>("species", initial: "")
+    let nickname = Value.Optional<String>("nickname")
+    let color = Transformable.Optional<UIColor>("color")
+}
+
+
+

Important

+ Transformable.Optional properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the property.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let color = Transformable.Optional<UIColor>(
    +        "color",
    +        isTransient: true,
    +        customGetter: Animal.getColor(_:)
    +    )
    +}
    +
    +private static func getColor(_ partialObject: PartialObject<Animal>) -> UIColor? {
    +    if let cachedColor = partialObject.primitiveValue(for: { $0.color }) {
    +        return cachedColor
    +    }
    +    let color: UIColor?
    +    switch partialObject.value(for: { $0.species }) {
    +
    +    case "Swift": color = UIColor.orange
    +    case "Bulbasaur": color = UIColor.green
    +    default: return nil
    +    }
    +    partialObject.setPrimitiveValue(color, for: { $0.color })
    +    return color
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(
    +    _ keyPath: KeyPathString,
    +    initial: @autoclosure @escaping () -> V? = nil,
    +    isTransient: Bool = false,
    +    allowsExternalBinaryDataStorage: Bool = false,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    customGetter: ((_ partialObject: PartialObject<O>) -> V?)? = nil,
    +    customSetter: ((_ partialObject: PartialObject<O>, _ newValue: V?) -> Void)? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent attribute name for this property.

    +
    +
    + + initial + + +
    +

    the initial value for the property when the object is first created. Defaults to the ImportableAttributeType‘s empty value if not specified.

    +
    +
    + + isTransient + + +
    +

    true if the property is transient, otherwise false. Defaults to false if not specified. The transient flag specifies whether or not a property’s value is ignored when an object is saved to a persistent store. Transient properties are not saved to the persistent store, but are still managed for undo, redo, validation, and so on.

    +
    +
    + + allowsExternalBinaryDataStorage + + +
    +

    true if the attribute allows external binary storage, otherwise false.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a property as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + customGetter + + +
    +

    use this closure as an override for the default property getter. The closure receives a PartialObject<O>, which acts as a fast, type-safe KVC interface for CoreStoreObject. The reason a CoreStoreObject instance is not passed directly is because the Core Data runtime is not aware of CoreStoreObject properties’ static typing, and so loading those info everytime KVO invokes this accessor method incurs a cumulative performance hit (especially in KVO-heavy operations such as ListMonitor observing.) When accessing the property value from PartialObject<O>, make sure to use PartialObject<O>.primitiveValue(for:) instead of PartialObject<O>.value(for:), which would unintentionally execute the same closure again recursively.

    +
    +
    + + customSetter + + +
    +

    use this closure as an override for the default property setter. The closure receives a PartialObject<O>, which acts as a fast, type-safe KVC interface for CoreStoreObject. The reason a CoreStoreObject instance is not passed directly is because the Core Data runtime is not aware of CoreStoreObject properties’ static typing, and so loading those info everytime KVO invokes this accessor method incurs a cumulative performance hit (especially in KVO-heavy operations such as ListMonitor observing.) When accessing the property value from PartialObject<O>, make sure to use PartialObject<O>.setPrimitiveValue(_:for:) instead of PartialObject<O>.setValue(_:for:), which would unintentionally execute the same closure again recursively.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + value + +
    +
    +
    +
    +
    +
    +

    The property value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var value: V? { get set }
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = O
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ValueType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ValueType = V
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_keyPathString + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var cs_keyPathString: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns an optional transformable value to the property. The operation

    +
    animal.color .= UIColor.red
    +
    + +

    is equivalent to

    +
    animal.color.value = UIColor.red
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= (property: TransformableContainer<O>.Optional<V>, newValue: V?)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns an optional transformable value from another property. The operation

    +
    animal.color .= anotherAnimal.color
    +
    + +

    is equivalent to

    +
    animal.color.value = anotherAnimal.color.value
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= <O2>(property: TransformableContainer<O>.Optional<V>, property2: TransformableContainer<O2>.Optional<V>) where O2 : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns a transformable value from another property. The operation

    +
    animal.color .= anotherAnimal.color
    +
    + +

    is equivalent to

    +
    animal.color.value = anotherAnimal.color.value
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= <O2>(property: TransformableContainer<O>.Optional<V>, property2: TransformableContainer<O2>.Required<V>) where O2 : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/TransformableContainer/Required.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/TransformableContainer/Required.html new file mode 100644 index 0000000..dcfe40e --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/TransformableContainer/Required.html @@ -0,0 +1,1227 @@ + + + + Required Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Required

+
+
+
public final class Required<V> : AttributeProtocol where V : NSCoding, V : NSCopying
+ +
+
+

The containing type for transformable properties. Any type that conforms to NSCoding & NSCopying are supported.

+
class Animal: CoreStoreObject {
+    let species = Value.Required<String>("species", initial: "")
+    let nickname = Value.Optional<String>("nickname")
+    let color = Transformable.Optional<UIColor>("color")
+}
+
+
+

Important

+ Transformable.Required properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the property.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let color = Transformable.Required<UIColor>(
    +        "color",
    +        initial: UIColor.clear,
    +        isTransient: true,
    +        customGetter: Animal.getColor(_:)
    +    )
    +}
    +
    +private static func getColor(_ partialObject: PartialObject<Animal>) -> UIColor {
    +    let cachedColor = partialObject.primitiveValue(for: { $0.color })
    +    if cachedColor != UIColor.clear {
    +
    +        return cachedColor
    +    }
    +    let color: UIColor
    +    switch partialObject.value(for: { $0.species }) {
    +
    +    case "Swift": color = UIColor.orange
    +    case "Bulbasaur": color = UIColor.green
    +    default: color = UIColor.black
    +    }
    +    partialObject.setPrimitiveValue(color, for: { $0.color })
    +    return color
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(
    +    _ keyPath: KeyPathString,
    +    initial: @autoclosure @escaping () -> V,
    +    isTransient: Bool = false,
    +    allowsExternalBinaryDataStorage: Bool = false,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    customGetter: ((_ partialObject: PartialObject<O>) -> V)? = nil,
    +    customSetter: ((_ partialObject: PartialObject<O>, _ newValue: V) -> Void)? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent attribute name for this property.

    +
    +
    + + initial + + +
    +

    the initial value for the property when the object is first created. Defaults to the ImportableAttributeType‘s empty value if not specified.

    +
    +
    + + isTransient + + +
    +

    true if the property is transient, otherwise false. Defaults to false if not specified. The transient flag specifies whether or not a property’s value is ignored when an object is saved to a persistent store. Transient properties are not saved to the persistent store, but are still managed for undo, redo, validation, and so on.

    +
    +
    + + allowsExternalBinaryDataStorage + + +
    +

    true if the attribute allows external binary storage, otherwise false.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a property as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + customGetter + + +
    +

    use this closure as an override for the default property getter. The closure receives a PartialObject<O>, which acts as a fast, type-safe KVC interface for CoreStoreObject. The reason a CoreStoreObject instance is not passed directly is because the Core Data runtime is not aware of CoreStoreObject properties’ static typing, and so loading those info everytime KVO invokes this accessor method incurs a cumulative performance hit (especially in KVO-heavy operations such as ListMonitor observing.) When accessing the property value from PartialObject<O>, make sure to use PartialObject<O>.primitiveValue(for:) instead of PartialObject<O>.value(for:), which would unintentionally execute the same closure again recursively.

    +
    +
    + + customSetter + + +
    +

    use this closure as an override for the default property setter. The closure receives a PartialObject<O>, which acts as a fast, type-safe KVC interface for CoreStoreObject. The reason a CoreStoreObject instance is not passed directly is because the Core Data runtime is not aware of CoreStoreObject properties’ static typing, and so loading those info everytime KVO invokes this accessor method incurs a cumulative performance hit (especially in KVO-heavy operations such as ListMonitor observing.) When accessing the property value from PartialObject<O>, make sure to use PartialObject<O>.setPrimitiveValue(_:for:) instead of PartialObject<O>.setValue(_:for:), which would unintentionally execute the same closure again recursively.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + value + +
    +
    +
    +
    +
    +
    +

    The property value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var value: V { get set }
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = O
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ValueType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ValueType = V
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_keyPathString + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var cs_keyPathString: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns a transformable value to the property. The operation

    +
    animal.color .= UIColor.red
    +
    + +

    is equivalent to

    +
    animal.color.value = UIColor.red
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= (property: TransformableContainer<O>.Required<V>, newValue: V)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns a transformable value from another property. The operation

    +
    animal.nickname .= anotherAnimal.species
    +
    + +

    is equivalent to

    +
    animal.nickname.value = anotherAnimal.species.value
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= <O2>(property: TransformableContainer<O>.Required<V>, property2: TransformableContainer<O2>.Required<V>) where O2 : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/ValueContainer.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/ValueContainer.html new file mode 100644 index 0000000..71aaa65 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/ValueContainer.html @@ -0,0 +1,890 @@ + + + + ValueContainer Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ValueContainer

+
+
+
public enum ValueContainer<O> where O : CoreStoreObject
+ +
+
+

The containing type for value properties. Use the DynamicObject.Value typealias instead for shorter syntax.

+
class Animal: CoreStoreObject {
+    let species = Value.Required<String>("species", initial: "")
+    let nickname = Value.Optional<String>("nickname")
+    let color = Transformable.Optional<UIColor>("color")
+}
+
+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + Required + +
    +
    +
    +
    +
    +
    +

    The containing type for required value properties. Any type that conforms to ImportableAttributeType are supported.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let nickname = Value.Optional<String>("nickname")
    +    let color = Transformable.Optional<UIColor>("color")
    +}
    +
    +
    +

    Important

    + Value.Required properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class Required<V> : AttributeProtocol where V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + Optional + +
    +
    +
    +
    +
    +
    +

    The containing type for optional value properties. Any type that conforms to ImportableAttributeType are supported.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let nickname = Value.Optional<String>("nickname")
    +    let color = Transformable.Optional<UIColor>("color")
    +}
    +
    +
    +

    Important

    + Value.Optional properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class Optional<V> : AttributeProtocol where V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/ValueContainer/Optional.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/ValueContainer/Optional.html new file mode 100644 index 0000000..aee47d5 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/ValueContainer/Optional.html @@ -0,0 +1,1647 @@ + + + + Optional Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Optional

+
+
+
public final class Optional<V> : AttributeProtocol where V : ImportableAttributeType
+ +
+
+

The containing type for optional value properties. Any type that conforms to ImportableAttributeType are supported.

+
class Animal: CoreStoreObject {
+    let species = Value.Required<String>("species", initial: "")
+    let nickname = Value.Optional<String>("nickname")
+    let color = Transformable.Optional<UIColor>("color")
+}
+
+
+

Important

+ Value.Optional properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the property.

    +
    class Person: CoreStoreObject {
    +    let title = Value.Optional<String>("title", initial: "Mr.")
    +    let name = Value.Optional<String>("name")
    +    let displayName = Value.Optional<String>(
    +        "displayName",
    +        isTransient: true,
    +        customGetter: Person.getName(_:)
    +    )
    +
    +    private static func getName(_ partialObject: PartialObject<Person>) -> String? {
    +        if let cachedDisplayName = partialObject.primitiveValue(for: { $0.displayName }) {
    +           return cachedDisplayName
    +        }
    +        let title = partialObject.value(for: { $0.title })
    +        let name = partialObject.value(for: { $0.name })
    +        let displayName = "\(title) \(name)"
    +        partialObject.setPrimitiveValue(displayName, for: { $0.displayName })
    +        return displayName
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(
    +    _ keyPath: KeyPathString,
    +    initial: @autoclosure @escaping () -> V? = nil,
    +    isTransient: Bool = false,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    customGetter: ((_ partialObject: PartialObject<O>) -> V?)? = nil,
    +    customSetter: ((_ partialObject: PartialObject<O>, _ newValue: V?) -> Void)? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent attribute name for this property.

    +
    +
    + + initial + + +
    +

    the initial value for the property when the object is first created. Defaults to nil if not specified.

    +
    +
    + + isTransient + + +
    +

    true if the property is transient, otherwise false. Defaults to false if not specified. The transient flag specifies whether or not a property’s value is ignored when an object is saved to a persistent store. Transient properties are not saved to the persistent store, but are still managed for undo, redo, validation, and so on.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a property as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + customGetter + + +
    +

    use this closure to make final transformations to the property’s value before returning from the getter.

    +
    +
    + + self + + +
    +

    the CoreStoreObject

    +
    +
    + + getValue + + +
    +

    the original getter for the property

    +
    +
    + + customSetter + + +
    +

    use this closure to make final transformations to the new value before assigning to the property.

    +
    +
    + + setValue + + +
    +

    the original setter for the property

    +
    +
    + + finalNewValue + + +
    +

    the transformed new value

    +
    +
    + + originalNewValue + + +
    +

    the original new value

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + value + +
    +
    +
    +
    +
    +
    +

    The property value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var value: V? { get set }
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where({ $0.nickname == "John" }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (attribute: ValueContainer<O>.Optional<V>, value: V?) -> Where<O>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is not equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where({ $0.nickname != "John" }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func != (attribute: ValueContainer<O>.Optional<V>, value: V?) -> Where<O>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is less than a value

    +
    let person = CoreStore.fetchOne(From<Person>().where({ $0.age < 20 }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func < (attribute: ValueContainer<O>.Optional<V>, value: V?) -> Where<O>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is greater than a value

    +
    let person = CoreStore.fetchOne(From<Person>().where({ $0.age > 20 }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func > (attribute: ValueContainer<O>.Optional<V>, value: V?) -> Where<O>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + <=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is less than or equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where({ $0.age <= 20 }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func <= (attribute: ValueContainer<O>.Optional<V>, value: V?) -> Where<O>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is greater than or equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where({ $0.age >= 20 }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func >= (attribute: ValueContainer<O>.Optional<V>, value: V?) -> Where<O>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ~=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by checking if a sequence contains the value of a property

    +
    let dog = CoreStore.fetchOne(From<Dog>().where({ ["Pluto", "Snoopy", "Scooby"] ~= $0.nickname }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ~= <S>(sequence: S, attribute: ValueContainer<O>.Optional<V>) -> Where<O> where V == S.Element, S : Sequence
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = O
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ValueType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ValueType = V
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_keyPathString + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var cs_keyPathString: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns an optional value to the property. The operation

    +
    animal.nickname .= "Taylor"
    +
    + +

    is equivalent to

    +
    animal.nickname.value = "Taylor"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= (property: ValueContainer<O>.Optional<V>, newValue: V?)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns an optional value from another property. The operation

    +
    animal.nickname .= anotherAnimal.nickname
    +
    + +

    is equivalent to

    +
    animal.nickname.value = anotherAnimal.nickname.value
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= <O2>(property: ValueContainer<O>.Optional<V>, property2: ValueContainer<O2>.Optional<V>) where O2 : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns a value from another property. The operation

    +
    animal.nickname .= anotherAnimal.species
    +
    + +

    is equivalent to

    +
    animal.nickname.value = anotherAnimal.species.value
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= <O2>(property: ValueContainer<O>.Optional<V>, property2: ValueContainer<O2>.Required<V>) where O2 : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares equality between a property’s value and another value

    +
    if animal.species .== "Swift" { ... }
    +
    + +

    is equivalent to

    +
    if animal.species.value == "Swift" { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== (property: ValueContainer<O>.Optional<V>, value: V?) -> Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares equality between a property’s value and another property’s value

    +
    if "Swift" .== animal.species { ... }
    +
    + +

    is equivalent to

    +
    if "Swift" == animal.species.value { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== (value: V?, property: ValueContainer<O>.Optional<V>) -> Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares equality between a property’s value and another property’s value

    +
    if animal.species .== anotherAnimal.species { ... }
    +
    + +

    is equivalent to

    +
    if animal.species.value == anotherAnimal.species.value { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== (property: ValueContainer<O>.Optional<V>, property2: ValueContainer<O>.Optional<V>) -> Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares equality between a property’s value and another property’s value

    +
    if animal.species .== anotherAnimal.species { ... }
    +
    + +

    is equivalent to

    +
    if animal.species.value == anotherAnimal.species.value { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== (property: ValueContainer<O>.Optional<V>, property2: ValueContainer<O>.Required<V>) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/ValueContainer/Required.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/ValueContainer/Required.html new file mode 100644 index 0000000..8e7bf99 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Enums/ValueContainer/Required.html @@ -0,0 +1,1556 @@ + + + + Required Class Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Required

+
+
+
public final class Required<V> : AttributeProtocol where V : ImportableAttributeType
+ +
+
+

The containing type for required value properties. Any type that conforms to ImportableAttributeType are supported.

+
class Animal: CoreStoreObject {
+    let species = Value.Required<String>("species", initial: "")
+    let nickname = Value.Optional<String>("nickname")
+    let color = Transformable.Optional<UIColor>("color")
+}
+
+
+

Important

+ Value.Required properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes the metadata for the property.

    +
    class Person: CoreStoreObject {
    +    let title = Value.Required<String>("title", initial: "Mr.")
    +    let name = Value.Required<String>("name", initial: "")
    +    let displayName = Value.Required<String>(
    +        "displayName",
    +        initial: "",
    +        isTransient: true,
    +        customGetter: Person.getName(_:)
    +    )
    +
    +    private static func getName(_ partialObject: PartialObject<Person>) -> String {
    +        let cachedDisplayName = partialObject.primitiveValue(for: { $0.displayName })
    +        if !cachedDisplayName.isEmpty {
    +            return cachedDisplayName
    +        }
    +        let title = partialObject.value(for: { $0.title })
    +        let name = partialObject.value(for: { $0.name })
    +        let displayName = "\(title) \(name)"
    +        partialObject.setPrimitiveValue(displayName, for: { $0.displayName })
    +        return displayName
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(
    +    _ keyPath: KeyPathString,
    +    initial: @autoclosure @escaping () -> V,
    +    isTransient: Bool = false,
    +    versionHashModifier: @autoclosure @escaping () -> String? = nil,
    +    renamingIdentifier: @autoclosure @escaping () -> String? = nil,
    +    customGetter: ((_ partialObject: PartialObject<O>) -> V)? = nil,
    +    customSetter: ((_ partialObject: PartialObject<O>, _ newValue: V) -> Void)? = nil,
    +    affectedByKeyPaths: @autoclosure @escaping () -> Set<String> = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + keyPath + + +
    +

    the permanent attribute name for this property.

    +
    +
    + + initial + + +
    +

    the initial value for the property when the object is first created

    +
    +
    + + isTransient + + +
    +

    true if the property is transient, otherwise false. Defaults to false if not specified. The transient flag specifies whether or not a property’s value is ignored when an object is saved to a persistent store. Transient properties are not saved to the persistent store, but are still managed for undo, redo, validation, and so on.

    +
    +
    + + versionHashModifier + + +
    +

    used to mark or denote a property as being a different version than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the properties are unchanged but the format or content of its data are changed.)

    +
    +
    + + renamingIdentifier + + +
    +

    used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will be the property’s name.

    +
    +
    + + customGetter + + +
    +

    use this closure as an override for the default property getter. The closure receives a PartialObject<O>, which acts as a fast, type-safe KVC interface for CoreStoreObject. The reason a CoreStoreObject instance is not passed directly is because the Core Data runtime is not aware of CoreStoreObject properties’ static typing, and so loading those info everytime KVO invokes this accessor method incurs a cumulative performance hit (especially in KVO-heavy operations such as ListMonitor observing.) When accessing the property value from PartialObject<O>, make sure to use PartialObject<O>.primitiveValue(for:) instead of PartialObject<O>.value(for:), which would unintentionally execute the same closure again recursively.

    +
    +
    + + customSetter + + +
    +

    use this closure as an override for the default property setter. The closure receives a PartialObject<O>, which acts as a fast, type-safe KVC interface for CoreStoreObject. The reason a CoreStoreObject instance is not passed directly is because the Core Data runtime is not aware of CoreStoreObject properties’ static typing, and so loading those info everytime KVO invokes this accessor method incurs a cumulative performance hit (especially in KVO-heavy operations such as ListMonitor observing.) When accessing the property value from PartialObject<O>, make sure to use PartialObject<O>.setPrimitiveValue(_:for:) instead of PartialObject<O>.setValue(_:for:), which would unintentionally execute the same closure again recursively.

    +
    +
    + + affectedByKeyPaths + + +
    +

    a set of key paths for properties whose values affect the value of the receiver. This is similar to NSManagedObject.keyPathsForValuesAffectingValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + value + +
    +
    +
    +
    +
    +
    +

    The property value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var value: V { get set }
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where({ $0.nickname == "John" }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (attribute: ValueContainer<O>.Required<V>, value: V) -> Where<O>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is not equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where({ $0.nickname != "John" }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func != (attribute: ValueContainer<O>.Required<V>, value: V) -> Where<O>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is less than a value

    +
    let person = CoreStore.fetchOne(From<Person>().where({ $0.age < 20 }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func < (attribute: ValueContainer<O>.Required<V>, value: V) -> Where<O>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is greater than a value

    +
    let person = CoreStore.fetchOne(From<Person>().where({ $0.age > 20 }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func > (attribute: ValueContainer<O>.Required<V>, value: V) -> Where<O>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + <=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is less than or equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where({ $0.age <= 20 }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func <= (attribute: ValueContainer<O>.Required<V>, value: V) -> Where<O>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is greater than or equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where({ $0.age >= 20 }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func >= (attribute: ValueContainer<O>.Required<V>, value: V) -> Where<O>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ~=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by checking if a sequence contains the value of a property

    +
    let dog = CoreStore.fetchOne(From<Dog>().where({ ["Pluto", "Snoopy", "Scooby"] ~= $0.nickname }))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ~= <S>(sequence: S, attribute: ValueContainer<O>.Required<V>) -> Where<O> where V == S.Element, S : Sequence
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = O
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ValueType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ValueType = V
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_keyPathString + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var cs_keyPathString: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns a value to the property. The operation

    +
    animal.species .= "Swift"
    +
    + +

    is equivalent to

    +
    animal.species.value = "Swift"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= (property: ValueContainer<O>.Required<V>, newValue: V)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Assigns a value from another property. The operation

    +
    animal.species .= anotherAnimal.species
    +
    + +

    is equivalent to

    +
    animal.species.value = anotherAnimal.species.value
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .= <O2>(property: ValueContainer<O>.Required<V>, property2: ValueContainer<O2>.Required<V>) where O2 : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares equality between a property’s value and another value

    +
    if animal.species .== "Swift" { ... }
    +
    + +

    is equivalent to

    +
    if animal.species.value == "Swift" { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== (property: ValueContainer<O>.Required<V>, value: V?) -> Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares equality between a value and a property’s value

    +
    if "Swift" .== animal.species { ... }
    +
    + +

    is equivalent to

    +
    if "Swift" == animal.species.value { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== (value: V?, property: ValueContainer<O>.Required<V>) -> Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares equality between a property’s value and another property’s value

    +
    if animal.species .== anotherAnimal.species { ... }
    +
    + +

    is equivalent to

    +
    if animal.species.value == anotherAnimal.species.value { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== (property: ValueContainer<O>.Required<V>, property2: ValueContainer<O>.Required<V>) -> Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + .==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Compares equality between a property’s value and another property’s value

    +
    if animal.species .== anotherAnimal.species { ... }
    +
    + +

    is equivalent to

    +
    if animal.species.value == anotherAnimal.species.value { ... }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func .== (property: ValueContainer<O>.Required<V>, property2: ValueContainer<O>.Optional<V>) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions.html new file mode 100644 index 0000000..fe59e63 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions.html @@ -0,0 +1,1881 @@ + + + + Extensions Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Extensions

+

The following extensions are available globally.

+ +
+
+ +
+
+
+ + +
+
+ +
    +
  • +
    + + + + KeyPath + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    class KeyPath<Root, Value> : PartialKeyPath<Root>
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + NSManagedObject + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    class NSManagedObject : NSObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + RawRepresentable + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    protocol RawRepresentable
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    class NSManagedObjectContext : NSObject, NSCoding, NSLocking
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + Sequence + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    protocol Sequence
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + Progress + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    class Progress : NSObject
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Bool

+
+
+
    +
  • +
    + + + + Bool + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CGFloat + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct CGFloat
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Data

+
+
+
    +
  • +
    + + + + Data + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessCollection, MutableCollection, RangeReplaceableCollection
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Date

+
+
+
    +
  • +
    + + + + Date + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct Date : ReferenceConvertible, Comparable, Equatable
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Double

+
+
+
    +
  • +
    + + + + Double + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct Double
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Float

+
+
+
    +
  • +
    + + + + Float + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct Float
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Int

+
+
+
    +
  • +
    + + + + Int + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct Int : FixedWidthInteger, SignedInteger
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Int8

+
+
+
    +
  • +
    + + + + Int8 + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct Int8 : FixedWidthInteger, SignedInteger
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Int16

+
+
+
    +
  • +
    + + + + Int16 + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct Int16 : FixedWidthInteger, SignedInteger
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Int32

+
+
+
    +
  • +
    + + + + Int32 + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct Int32 : FixedWidthInteger, SignedInteger
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Int64

+
+
+
    +
  • +
    + + + + Int64 + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct Int64 : FixedWidthInteger, SignedInteger
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

NSData

+
+
+
    +
  • +
    + + + + NSData + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    class NSData : NSObject, NSCopying, NSMutableCopying, NSSecureCoding
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

NSDate

+
+
+
    +
  • +
    + + + + NSDate + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    class NSDate : NSObject, NSCopying, NSSecureCoding
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + NSManagedObjectID + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    class NSManagedObjectID : NSObject, NSCopying
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

NSNull

+
+
+
    +
  • +
    + + + + NSNull + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    class NSNull : NSObject, NSCopying, NSSecureCoding
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + NSNumber + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    class NSNumber : NSValue
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + NSString + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    class NSString : NSObject, NSCopying, NSMutableCopying, NSSecureCoding
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

NSURL

+
+
+
    +
  • +
    + + + + NSURL + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    class NSURL : NSObject, NSSecureCoding, NSCopying
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

NSUUID

+
+
+
    +
  • +
    + + + + NSUUID + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    class NSUUID : NSObject, NSCopying, NSSecureCoding
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

String

+
+
+
    +
  • +
    + + + + String + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct String
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

URL

+
+
+
    +
  • +
    + + + + URL + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct URL : ReferenceConvertible, Equatable
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

UUID

+
+
+
    +
  • +
    + + + + UUID + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.8, iOS 6.0, *)
    +struct UUID : ReferenceConvertible, Hashable, Equatable, CustomStringConvertible
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Bool.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Bool.html new file mode 100644 index 0000000..0b38074 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Bool.html @@ -0,0 +1,893 @@ + + + + Bool Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Bool

+
+
+
struct Bool
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSNumber
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let cs_rawAttributeType: NSAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> Bool?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/CGFloat.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/CGFloat.html new file mode 100644 index 0000000..e294427 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/CGFloat.html @@ -0,0 +1,893 @@ + + + + CGFloat Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CGFloat

+
+
+
struct CGFloat
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSNumber
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let cs_rawAttributeType: NSAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> CGFloat?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Data.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Data.html new file mode 100644 index 0000000..9c7015a --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Data.html @@ -0,0 +1,893 @@ + + + + Data Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Data

+
+
+
struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessCollection, MutableCollection, RangeReplaceableCollection
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSData
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let cs_rawAttributeType: NSAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> Data?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Date.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Date.html new file mode 100644 index 0000000..d991672 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Date.html @@ -0,0 +1,893 @@ + + + + Date Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Date

+
+
+
struct Date : ReferenceConvertible, Comparable, Equatable
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSDate
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let cs_rawAttributeType: NSAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> Date?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Double.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Double.html new file mode 100644 index 0000000..e5f5eab --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Double.html @@ -0,0 +1,893 @@ + + + + Double Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Double

+
+
+
struct Double
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSNumber
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let cs_rawAttributeType: NSAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> Double?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Float.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Float.html new file mode 100644 index 0000000..e42b7d2 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Float.html @@ -0,0 +1,893 @@ + + + + Float Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Float

+
+
+
struct Float
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSNumber
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let cs_rawAttributeType: NSAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> Float?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Int.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Int.html new file mode 100644 index 0000000..6112bb6 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Int.html @@ -0,0 +1,893 @@ + + + + Int Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Int

+
+
+
struct Int : FixedWidthInteger, SignedInteger
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSNumber
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let cs_rawAttributeType: NSAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> Int?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Int16.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Int16.html new file mode 100644 index 0000000..c4fad99 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Int16.html @@ -0,0 +1,893 @@ + + + + Int16 Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Int16

+
+
+
struct Int16 : FixedWidthInteger, SignedInteger
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSNumber
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let cs_rawAttributeType: NSAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> Int16?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Int32.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Int32.html new file mode 100644 index 0000000..0296085 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Int32.html @@ -0,0 +1,893 @@ + + + + Int32 Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Int32

+
+
+
struct Int32 : FixedWidthInteger, SignedInteger
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSNumber
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let cs_rawAttributeType: NSAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> Int32?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Int64.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Int64.html new file mode 100644 index 0000000..2c02cd7 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Int64.html @@ -0,0 +1,893 @@ + + + + Int64 Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Int64

+
+
+
struct Int64 : FixedWidthInteger, SignedInteger
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSNumber
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let cs_rawAttributeType: NSAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> Int64?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Int8.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Int8.html new file mode 100644 index 0000000..2f46222 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Int8.html @@ -0,0 +1,893 @@ + + + + Int8 Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Int8

+
+
+
struct Int8 : FixedWidthInteger, SignedInteger
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSNumber
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let cs_rawAttributeType: NSAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> Int8?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/KeyPath.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/KeyPath.html new file mode 100644 index 0000000..3a0b001 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/KeyPath.html @@ -0,0 +1,865 @@ + + + + KeyPath Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

KeyPath

+
+
+
class KeyPath<Root, Value> : PartialKeyPath<Root>
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = Root
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ValueType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ValueType = Value
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_keyPathString + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var cs_keyPathString: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/KeyPathString.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/KeyPathString.html new file mode 100644 index 0000000..e91085d --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/KeyPathString.html @@ -0,0 +1,845 @@ + + + + KeyPathString Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

KeyPathString

+
+
+
public typealias KeyPathString = String
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + init(keyPath:) + +
    +
    +
    +
    +
    +
    +

    Extracts the keyPath string from the property.

    +
    let keyPath = String(keyPath: \Person.nickname)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<O, V>(keyPath: KeyPath<O, V>) where O : NSManagedObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(keyPath:) + +
    +
    +
    +
    +
    +
    +

    Extracts the keyPath string from the property.

    +
    let keyPath = String(keyPath: \Person.nickname)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<O, K>(keyPath: KeyPath<O, K>) where O : CoreStoreObject, K : DynamicKeyPath
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSData.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSData.html new file mode 100644 index 0000000..5f665c1 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSData.html @@ -0,0 +1,896 @@ + + + + NSData Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

NSData

+
+
+
class NSData : NSObject, NSCopying, NSMutableCopying, NSSecureCoding
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSData
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public class var cs_rawAttributeType: NSAttributeType { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public class func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> `Self`?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSDate.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSDate.html new file mode 100644 index 0000000..1f59a84 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSDate.html @@ -0,0 +1,896 @@ + + + + NSDate Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

NSDate

+
+
+
class NSDate : NSObject, NSCopying, NSSecureCoding
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSDate
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public class var cs_rawAttributeType: NSAttributeType { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public class func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> `Self`?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSManagedObject.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSManagedObject.html new file mode 100644 index 0000000..050e864 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSManagedObject.html @@ -0,0 +1,1675 @@ + + + + NSManagedObject Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

NSManagedObject

+
+
+
class NSManagedObject : NSObject
+ +
+
+ +
+
+ +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class func cs_forceCreate(entityDescription: NSEntityDescription, into context: NSManagedObjectContext, assignTo store: NSPersistentStore) -> Self
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_fromRaw(object:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class func cs_fromRaw(object: NSManagedObject) -> Self
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_matches(object:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func cs_matches(object: NSManagedObject) -> Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_id() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cs_id() -> NSManagedObjectID
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_toRaw() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cs_toRaw() -> NSManagedObject
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + fetchSource() + +
    +
    +
    +
    +
    +
    +

    Exposes a FetchableSource that can fetch sibling objects of this NSManagedObject instance. This may be the DataStack, a BaseDataTransaction, the NSManagedObjectContext itself, or nil if the obejct’s parent is already deallocated.

    +
    +

    Warning

    + Future implementations may change the instance returned by this method depending on the timing or condition that fetchSource() was called. Do not make assumptions that the instance will be a specific instance. If the NSManagedObjectContext instance is desired, use the FetchableSource.unsafeContext() method to get the correct instance. Also, do not assume that the fetchSource() and querySource() return the same instance all the time. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchSource() -> FetchableSource?
    + +
    +
    +
    +

    Return Value

    +

    a FetchableSource that can fetch sibling objects of this NSManagedObject instance. This may be the DataStack, a BaseDataTransaction, the NSManagedObjectContext itself, or nil if the object’s parent is already deallocated.

    +
    +
    +
    +
  • +
  • +
    + + + + querySource() + +
    +
    +
    +
    +
    +
    +

    Exposes a QueryableSource that can query attributes and aggregate values. This may be the DataStack, a BaseDataTransaction, the NSManagedObjectContext itself, or nil if the obejct’s parent is already deallocated.

    +
    +

    Warning

    + Future implementations may change the instance returned by this method depending on the timing or condition that querySource() was called. Do not make assumptions that the instance will be a specific instance. If the NSManagedObjectContext instance is desired, use the QueryableSource.unsafeContext() method to get the correct instance. Also, do not assume that the fetchSource() and querySource() return the same instance all the time. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func querySource() -> QueryableSource?
    + +
    +
    +
    +

    Return Value

    +

    a QueryableSource that can query attributes and aggregate values. This may be the DataStack, a BaseDataTransaction, the NSManagedObjectContext itself, or nil if the object’s parent is already deallocated.

    +
    +
    +
    +
  • +
  • +
    + + + + getValue(forKvcKey:) + +
    +
    +
    +
    +
    +
    +

    Provides a convenience wrapper for accessing primitiveValue(forKey:) with proper calls to willAccessValue(forKey:) and didAccessValue(forKey:). This is useful when implementing accessor methods for transient attributes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public func getValue(forKvcKey kvcKey: KeyPathString) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + kvcKey + + +
    +

    the KVC key

    +
    +
    +
    +
    +

    Return Value

    +

    the primitive value for the KVC key

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Provides a convenience wrapper for accessing primitiveValue(forKey:) with proper calls to willAccessValue(forKey:) and didAccessValue(forKey:). This is useful when implementing accessor methods for transient attributes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public func getValue<T>(forKvcKey kvcKey: KeyPathString, didGetValue: (Any?) throws -> T) rethrows -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + kvcKey + + +
    +

    the KVC key

    +
    +
    + + didGetValue + + +
    +

    a closure to transform the primitive value

    +
    +
    +
    +
    +

    Return Value

    +

    the primitive value transformed by the didGetValue closure

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Provides a convenience wrapper for accessing primitiveValue(forKey:) with proper calls to willAccessValue(forKey:) and didAccessValue(forKey:). This is useful when implementing accessor methods for transient attributes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public func getValue<T>(forKvcKey kvcKey: KeyPathString, willGetValue: () throws -> Void, didGetValue: (Any?) throws -> T) rethrows -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + kvcKey + + +
    +

    the KVC key

    +
    +
    + + willGetValue + + +
    +

    called before accessing primitiveValue(forKey:). Callers are allowed to cancel the access by throwing an error.

    +
    +
    + + didGetValue + + +
    +

    a closure to transform the primitive value

    +
    +
    +
    +
    +

    Return Value

    +

    the primitive value transformed by the didGetValue closure

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Provides a convenience wrapper for setting setPrimitiveValue(_:forKey:) with proper calls to willChangeValue(forKey:) and didChangeValue(forKey:). This is useful when implementing mutator methods for transient attributes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public func setValue(_ value: Any?, forKvcKey KVCKey: KeyPathString)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + value + + +
    +

    the value to set the KVC key with

    +
    +
    + + KVCKey + + +
    +

    the KVC key

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Provides a convenience wrapper for setting setPrimitiveValue(_:forKey:) with proper calls to willChangeValue(forKey:) and didChangeValue(forKey:).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public func setValue(_ value: Any?, forKvcKey KVCKey: KeyPathString, didSetValue: () -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + value + + +
    +

    the value to set the KVC key with

    +
    +
    + + KVCKey + + +
    +

    the KVC key

    +
    +
    + + didSetValue + + +
    +

    called after executing setPrimitiveValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Provides a convenience wrapper for setting setPrimitiveValue(_:forKey:) with proper calls to willChangeValue(forKey:) and didChangeValue(forKey:). This is useful when implementing mutator methods for transient attributes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public func setValue<T>(_ value: T, forKvcKey KVCKey: KeyPathString, willSetValue: (T) throws -> Any?, didSetValue: (Any?) -> Void = { _ in }) rethrows
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + value + + +
    +

    the value to set the KVC key with

    +
    +
    + + KVCKey + + +
    +

    the KVC key

    +
    +
    + + willSetValue + + +
    +

    called before accessing setPrimitiveValue(forKey:). Callers are allowed to cancel the mutation by throwing an error, for example, for custom validations.

    +
    +
    + + didSetValue + + +
    +

    called after executing setPrimitiveValue(forKey:).

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + refreshAsFault() + +
    +
    +
    +
    +
    +
    +

    Re-faults the object to use the latest values from the persistent store

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func refreshAsFault()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + refreshAndMerge() + +
    +
    +
    +
    +
    +
    +

    Re-faults the object to use the latest values from the persistent store and merges previously pending changes back

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func refreshAndMerge()
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Provides a convenience wrapper for accessing -primitiveValueForKey: with proper calls to -willAccessValueForKey: and -didAccessValueForKey:. This is useful when implementing accessor methods for transient attributes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func cs_accessValueForKVCKey(_ KVCKey: KeyPathString) -> Any?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + KVCKey + + +
    +

    the KVC key

    +
    +
    +
    +
    +

    Return Value

    +

    the primitive value for the KVC key

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Provides a convenience wrapper for setting -setPrimitiveValue: with proper calls to -willChangeValueForKey: and -didChangeValueForKey:. This is useful when implementing mutator methods for transient attributes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func cs_setValue(_ value: Any?, forKVCKey KVCKey: KeyPathString)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + value + + +
    +

    the value to set the KVC key with

    +
    +
    + + KVCKey + + +
    +

    the KVC key

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_refreshAsFault() + +
    +
    +
    +
    +
    +
    +

    Re-faults the object to use the latest values from the persistent store

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func cs_refreshAsFault()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_refreshAndMerge() + +
    +
    +
    +
    +
    +
    +

    Re-faults the object to use the latest values from the persistent store and merges previously pending changes back

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func cs_refreshAndMerge()
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + unsafeDataTransaction + +
    +
    +
    +
    +
    +
    +

    Returns this object’s parent UnsafeDataTransaction instance if it was created from one. Returns nil if the parent transaction is either an AsynchronousDataTransaction or a SynchronousDataTransaction, or if the object is not managed by CoreStore.

    + +

    When using an UnsafeDataTransaction and passing around a temporary object, you can use this property to execute fetches and updates to the transaction without having to pass around both the object and the transaction instances.

    +
    +

    Important

    + The internal reference to the transaction is weak, and it is still the developer’s responsibility to retain a strong reference to the UnsafeDataTransaction. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public var unsafeDataTransaction: UnsafeDataTransaction? { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSManagedObjectContext.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSManagedObjectContext.html new file mode 100644 index 0000000..1cc6acd --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSManagedObjectContext.html @@ -0,0 +1,1517 @@ + + + + NSManagedObjectContext Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

NSManagedObjectContext

+
+
+
class NSManagedObjectContext : NSObject, NSCoding, NSLocking
+ +
+
+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchExisting<D>(_ object: D) -> D? where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchExisting<D>(_ objectID: NSManagedObjectID) -> D? where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchExisting<D, S>(_ objects: S) -> [D] where D : DynamicObject, D == S.Element, S : Sequence
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchExisting<D, S>(_ objectIDs: S) -> [D] where D : DynamicObject, S : Sequence, S.Element == NSManagedObjectID
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchOne<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> D? where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchOne<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> D? where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchOne<B>(_ clauseChain: B) -> B.ObjectType? where B : FetchChainableBuilderType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchAll<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> [D]? where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchAll<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> [D]? where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchAll<B>(_ clauseChain: B) -> [B.ObjectType]? where B : FetchChainableBuilderType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchCount<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> Int? where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchCount<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> Int? where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchCount<B>(_ clauseChain: B) -> Int? where B : FetchChainableBuilderType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> NSManagedObjectID? where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> NSManagedObjectID? where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchObjectID<B>(_ clauseChain: B) -> NSManagedObjectID? where B : FetchChainableBuilderType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> [NSManagedObjectID]? where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> [NSManagedObjectID]? where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func fetchObjectIDs<B>(_ clauseChain: B) -> [NSManagedObjectID]? where B : FetchChainableBuilderType
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + unsafeContext() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func unsafeContext() -> NSManagedObjectContext
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSManagedObjectID.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSManagedObjectID.html new file mode 100644 index 0000000..18f4276 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSManagedObjectID.html @@ -0,0 +1,896 @@ + + + + NSManagedObjectID Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

NSManagedObjectID

+
+
+
class NSManagedObjectID : NSObject, NSCopying
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSManagedObjectID
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public class var cs_rawAttributeType: NSAttributeType { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public class func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> `Self`?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSNull.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSNull.html new file mode 100644 index 0000000..c0259ad --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSNull.html @@ -0,0 +1,896 @@ + + + + NSNull Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

NSNull

+
+
+
class NSNull : NSObject, NSCopying, NSSecureCoding
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSNull
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public class var cs_rawAttributeType: NSAttributeType { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public class func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> `Self`?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSNumber.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSNumber.html new file mode 100644 index 0000000..c0512fa --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSNumber.html @@ -0,0 +1,896 @@ + + + + NSNumber Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

NSNumber

+
+
+
class NSNumber : NSValue
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSNumber
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public class var cs_rawAttributeType: NSAttributeType { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public class func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> `Self`?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSString.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSString.html new file mode 100644 index 0000000..22d54a5 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSString.html @@ -0,0 +1,896 @@ + + + + NSString Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

NSString

+
+
+
class NSString : NSObject, NSCopying, NSMutableCopying, NSSecureCoding
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSString
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public class var cs_rawAttributeType: NSAttributeType { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public class func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> `Self`?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSURL.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSURL.html new file mode 100644 index 0000000..0239e6d --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSURL.html @@ -0,0 +1,896 @@ + + + + NSURL Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

NSURL

+
+
+
class NSURL : NSObject, NSSecureCoding, NSCopying
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSString
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public class var cs_rawAttributeType: NSAttributeType { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public class func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> `Self`?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSUUID.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSUUID.html new file mode 100644 index 0000000..8f10245 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/NSUUID.html @@ -0,0 +1,896 @@ + + + + NSUUID Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

NSUUID

+
+
+
class NSUUID : NSObject, NSCopying, NSSecureCoding
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSString
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public class var cs_rawAttributeType: NSAttributeType { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public class func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> `Self`?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +@inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Progress.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Progress.html new file mode 100644 index 0000000..b383222 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Progress.html @@ -0,0 +1,885 @@ + + + + Progress Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Progress

+
+
+
class Progress : NSObject
+ +
+
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Sets a closure that the Progress calls whenever its fractionCompleted changes. You can use this instead of setting up KVO.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public func setProgressHandler(_ closure: ((_ progress: Progress) -> Void)?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + closure + + +
    +

    the closure to execute on progress change

    +
    +
    +
    +
    +
    +
  • +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Sets a closure that the NSProgress calls whenever its fractionCompleted changes. You can use this instead of setting up KVO.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public func cs_setProgressHandler(_ closure: ((_ progress: Progress) -> Void)?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + closure + + +
    +

    the closure to execute on progress change

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/RawRepresentable.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/RawRepresentable.html new file mode 100644 index 0000000..455c482 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/RawRepresentable.html @@ -0,0 +1,843 @@ + + + + RawRepresentable Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

RawRepresentable

+
+
+
protocol RawRepresentable
+ +
+
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Creates an instance of this type from its QueryableNativeType value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> Self?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates QueryableNativeType value from this instance.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Sequence.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Sequence.html new file mode 100644 index 0000000..1a4cf77 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/Sequence.html @@ -0,0 +1,872 @@ + + + + Sequence Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Sequence

+
+
+
protocol Sequence
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + combined() + +
    +
    +
    +
    +
    +
    +

    Combines multiple OrderBy predicates together

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func combined() -> OrderBy<Iterator.Element.ObjectType>
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + combinedByAnd() + +
    +
    +
    +
    +
    +
    +

    Combines multiple Where predicates together using AND operator

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func combinedByAnd() -> Where<Iterator.Element.ObjectType>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + combinedByOr() + +
    +
    +
    +
    +
    +
    +

    Combines multiple Where predicates together using OR operator

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func combinedByOr() -> Where<Iterator.Element.ObjectType>
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/String.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/String.html new file mode 100644 index 0000000..7f84afd --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/String.html @@ -0,0 +1,893 @@ + + + + String Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

String

+
+
+
struct String
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSString
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let cs_rawAttributeType: NSAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> String?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/URL.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/URL.html new file mode 100644 index 0000000..30120c2 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/URL.html @@ -0,0 +1,893 @@ + + + + URL Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

URL

+
+
+
struct URL : ReferenceConvertible, Equatable
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSString
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let cs_rawAttributeType: NSAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> URL?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/UUID.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/UUID.html new file mode 100644 index 0000000..de73001 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Extensions/UUID.html @@ -0,0 +1,894 @@ + + + + UUID Extension Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

UUID

+
+
+
@available(OSX 10.8, iOS 6.0, *)
+struct UUID : ReferenceConvertible, Hashable, Equatable, CustomStringConvertible
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + QueryableNativeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias QueryableNativeType = NSString
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_rawAttributeType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let cs_rawAttributeType: NSAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public static func cs_fromQueryableNativeType(_ value: QueryableNativeType) -> UUID?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inline(__always)
    +public func cs_toQueryableNativeType() -> QueryableNativeType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Functions.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Functions.html new file mode 100644 index 0000000..3a56427 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Functions.html @@ -0,0 +1,2204 @@ + + + + Functions Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Functions

+

The following functions are available globally.

+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.nickname == "John"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <O, V>(keyPath: KeyPath<O, V>, value: V) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is not equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.nickname != "John"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <O, V>(keyPath: KeyPath<O, V>, value: V) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ~=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by checking if a sequence contains the value of a property

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(["Pluto", "Snoopy", "Scooby"] ~= \.nickname))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func ~= <O, V, S>(sequence: S, keyPath: KeyPath<O, V>) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V == S.Element, S : Sequence
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.nickname == "John"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <O, V>(keyPath: KeyPath<O, Optional<V>>, value: V?) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is not equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.nickname != "John"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <O, V>(keyPath: KeyPath<O, Optional<V>>, value: V?) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ~=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by checking if a sequence contains the value of a property

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(["Pluto", "Snoopy", "Scooby"] ~= \.nickname))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func ~= <O, V, S>(sequence: S, keyPath: KeyPath<O, Optional<V>>) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V == S.Element, S : Sequence
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is less than a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age < 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func < <O, V>(keyPath: KeyPath<O, V>, value: V) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V : Comparable
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is greater than a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age > 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func > <O, V>(keyPath: KeyPath<O, V>, value: V) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V : Comparable
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + <=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is less than or equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age <= 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func <= <O, V>(keyPath: KeyPath<O, V>, value: V) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V : Comparable
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is greater than or equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age >= 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func >= <O, V>(keyPath: KeyPath<O, V>, value: V) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V : Comparable
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is less than a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age < 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func < <O, V>(keyPath: KeyPath<O, Optional<V>>, value: V?) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V : Comparable
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is greater than a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age > 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func > <O, V>(keyPath: KeyPath<O, Optional<V>>, value: V?) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V : Comparable
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + <=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is less than or equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age <= 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func <= <O, V>(keyPath: KeyPath<O, Optional<V>>, value: V?) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V : Comparable
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is greater than or equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age >= 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func >= <O, V>(keyPath: KeyPath<O, Optional<V>>, value: V?) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V : Comparable
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is equal to a value

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(\.master == john))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <O, D>(keyPath: KeyPath<O, D>, object: D) -> Where<O> where O : NSManagedObject, D : NSManagedObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is not equal to a value

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(\.master != john))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <O, D>(keyPath: KeyPath<O, D>, object: D) -> Where<O> where O : NSManagedObject, D : NSManagedObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ~=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by checking if a sequence contains a value of a property

    +
    let dog = CoreStore.fetchOne(From<Dog>().where([john, bob, joe] ~= \.master))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func ~= <O, D, S>(sequence: S, keyPath: KeyPath<O, D>) -> Where<O> where O : NSManagedObject, D : NSManagedObject, D == S.Element, S : Sequence
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is equal to a value

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(\.master == john))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <O, D>(keyPath: KeyPath<O, D>, objectID: NSManagedObjectID) -> Where<O> where O : NSManagedObject, D : NSManagedObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is not equal to a value

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(\.master != john))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <O, D>(keyPath: KeyPath<O, D>, objectID: NSManagedObjectID) -> Where<O> where O : NSManagedObject, D : NSManagedObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ~=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by checking if a sequence contains a value of a property

    +
    let dog = CoreStore.fetchOne(From<Dog>().where([john, bob, joe] ~= \.master))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func ~= <O, D, S>(sequence: S, keyPath: KeyPath<O, D>) -> Where<O> where O : NSManagedObject, D : NSManagedObject, S : Sequence, S.Element == NSManagedObjectID
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is equal to a value

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(\.master == john))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <O, D>(keyPath: KeyPath<O, Optional<D>>, object: D?) -> Where<O> where O : NSManagedObject, D : NSManagedObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is not equal to a value

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(\.master != john))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <O, D>(keyPath: KeyPath<O, Optional<D>>, object: D?) -> Where<O> where O : NSManagedObject, D : NSManagedObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ~=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by checking if a sequence contains a value of a property

    +
    let dog = CoreStore.fetchOne(From<Dog>().where([john, bob, joe] ~= \.master))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func ~= <O, D, S>(sequence: S, keyPath: KeyPath<O, Optional<D>>) -> Where<O> where O : NSManagedObject, D : NSManagedObject, D == S.Element, S : Sequence
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is equal to a value

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(\.master == john))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <O, D>(keyPath: KeyPath<O, Optional<D>>, objectID: NSManagedObjectID) -> Where<O> where O : NSManagedObject, D : NSManagedObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is not equal to a value

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(\.master != john))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <O, D>(keyPath: KeyPath<O, Optional<D>>, objectID: NSManagedObjectID) -> Where<O> where O : NSManagedObject, D : NSManagedObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ~=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by checking if a sequence contains a value of a property

    +
    let dog = CoreStore.fetchOne(From<Dog>().where([john, bob, joe] ~= \.master))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func ~= <O, D, S>(sequence: S, keyPath: KeyPath<O, Optional<D>>) -> Where<O> where O : NSManagedObject, D : NSManagedObject, S : Sequence, S.Element == NSManagedObjectID
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.nickname == "John"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Required<V>>, value: V) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is not equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.nickname != "John"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Required<V>>, value: V) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ~=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by checking if a sequence contains the value of a property

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(["Pluto", "Snoopy", "Scooby"] ~= \.nickname))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func ~= <O, V, S>(sequence: S, keyPath: KeyPath<O, ValueContainer<O>.Required<V>>) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType, V == S.Element, S : Sequence
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.nickname == "John"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Optional<V>>, value: V?) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is not equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.nickname != "John"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Optional<V>>, value: V?) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ~=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by checking if a sequence contains the value of a property

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(["Pluto", "Snoopy", "Scooby"] ~= \.nickname))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func ~= <O, V, S>(sequence: S, keyPath: KeyPath<O, ValueContainer<O>.Optional<V>>) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType, V == S.Element, S : Sequence
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is less than a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age < 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func < <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Required<V>>, value: V) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType, V : Comparable
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is greater than a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age > 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func > <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Required<V>>, value: V) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType, V : Comparable
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + <=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is less than or equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age <= 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func <= <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Required<V>>, value: V) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType, V : Comparable
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is greater than or equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age >= 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func >= <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Required<V>>, value: V) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType, V : Comparable
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is less than a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age < 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func < <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Optional<V>>, value: V?) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is greater than a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age > 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func > <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Optional<V>>, value: V?) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + <=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is less than or equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age <= 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func <= <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Optional<V>>, value: V?) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is greater than or equal to a value

    +
    let person = CoreStore.fetchOne(From<Person>().where(\.age >= 20))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func >= <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Optional<V>>, value: V?) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is equal to a value

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(\.master == john))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <O, D>(keyPath: KeyPath<O, RelationshipContainer<O>.ToOne<D>>, object: D) -> Where<O> where O : CoreStoreObject, D : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is equal to a value

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(\.master == john))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <O, D>(keyPath: KeyPath<O, RelationshipContainer<O>.ToOne<D>>, object: D?) -> Where<O> where O : CoreStoreObject, D : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is not equal to a value

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(\.master != john))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <O, D>(keyPath: KeyPath<O, RelationshipContainer<O>.ToOne<D>>, object: D) -> Where<O> where O : CoreStoreObject, D : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by comparing if a property is not equal to a value

    +
    let dog = CoreStore.fetchOne(From<Dog>().where(\.master != john))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <O, D>(keyPath: KeyPath<O, RelationshipContainer<O>.ToOne<D>>, object: D?) -> Where<O> where O : CoreStoreObject, D : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ~=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a Where clause by checking if a sequence contains a value of a property

    +
    let dog = CoreStore.fetchOne(From<Dog>().where([john, bob, joe] ~= \.master))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func ~= <O, D, S>(sequence: S, keyPath: KeyPath<O, RelationshipContainer<O>.ToOne<D>>) -> Where<O> where O : CoreStoreObject, D : CoreStoreObject, D == S.Element, S : Sequence
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Global Variables.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Global Variables.html new file mode 100644 index 0000000..48c9de9 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Global Variables.html @@ -0,0 +1,817 @@ + + + + Global Variables Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Global Variables

+

The following global variables are available globally.

+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + CoreStoreErrorDomain + +
    +
    +
    +
    +
    +
    +

    The NSError error domain string for CSError.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @nonobjc
    +public let CoreStoreErrorDomain: String
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols.html new file mode 100644 index 0000000..b6a3c7b --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols.html @@ -0,0 +1,2785 @@ + + + + Protocols Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Protocols

+

The following protocols are available globally.

+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + CSFetchClause + +
    +
    +
    +
    +
    +
    +

    The CSFetchClause implement clauses used to configure NSFetchRequests.

    +
    +

    See also

    + FetchClause + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public protocol CSFetchClause
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CSQueryClause + +
    +
    +
    +
    +
    +
    +

    The CSQueryClause implement clauses used to configure NSFetchRequests.

    +
    +

    See also

    + QueryClause + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public protocol CSQueryClause
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CSDeleteClause + +
    +
    +
    +
    +
    +
    +

    The CSDeleteClause implement clauses used to configure NSFetchRequests.

    +
    +

    See also

    + DeleteClause + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public protocol CSDeleteClause
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CSDynamicSchema + +
    +
    +
    +
    +
    +
    +

    The CSDynamicSchema serves as the Objective-C bridging type for DynamicSchema.

    +
    +

    See also

    + DynamicSchema + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public protocol CSDynamicSchema
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CSListObserver + +
    +
    +
    +
    +
    +
    +

    Implement the CSListObserver protocol to observe changes to a list of NSManagedObjects. CSListObservers may register themselves to a CSListMonitor‘s -addListObserver: method:

    +
    CSListMonitor *monitor = [CSCoreStore 
    +    monitorListFrom:[CSFrom entityClass:[MyPersonEntity class]]
    +    fetchClauses:@[[CSOrderBy sortDescriptor:[CSSortKey withKeyPath:@"lastName" ascending:YES]]]];
    +[monitor addListObserver:self];
    +
    +
    +

    See also

    + ListObserver + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +@objc
    +public protocol CSListObserver : AnyObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CSListObjectObserver + +
    +
    +
    +
    +
    +
    +

    Implement the CSListObjectObserver protocol to observe detailed changes to a list’s object. CSListObjectObservers may register themselves to a CSListMonitor‘s -addListObjectObserver(_:) method:

    +
    CSListMonitor *monitor = [CSCoreStore
    +    monitorListFrom:[CSFrom entityClass:[MyPersonEntity class]]
    +    fetchClauses:@[[CSOrderBy sortDescriptor:[CSSortKey withKeyPath:@"lastName" ascending:YES]]]];
    +[monitor addListObjectObserver:self];
    +
    +
    +

    See also

    + ListObjectObserver + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +@objc
    +public protocol CSListObjectObserver : CSListObserver
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CSListSectionObserver + +
    +
    +
    +
    +
    +
    +

    Implement the CSListSectionObserver protocol to observe changes to a list’s section info. CSListSectionObservers may register themselves to a CSListMonitor‘s -addListSectionObserver: method:

    +
    CSListMonitor *monitor = [CSCoreStore
    +    monitorSectionedListFrom:[CSFrom entityClass:[MyPersonEntity class]]
    +    sectionBy:[CSSectionBy keyPath:@"age"]
    +    fetchClauses:@[[CSOrderBy sortDescriptor:[CSSortKey withKeyPath:@"lastName" ascending:YES]]]];
    +[monitor addListSectionObserver:self];
    +
    +
    +

    See also

    + ListSectionObserver + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +@objc
    +public protocol CSListSectionObserver : CSListObjectObserver
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CSObjectObserver + +
    +
    +
    +
    +
    +
    +

    Implement the CSObjectObserver protocol to observe changes to a single NSManagedObject instance. CSObjectObservers may register themselves to a CSObjectMonitor‘s -addObjectObserver: method:

    +
    CSObjectMonitor *monitor = [CSCoreStore monitorObject:myObject];
    +[monitor addObjectObserver:self];
    +
    +
    +

    See also

    + ObjectObserver + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +@objc
    +public protocol CSObjectObserver : AnyObject
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ + +
+
+ +
    +
  • +
    + + + + CoreDataNativeType + +
    +
    +
    +
    +
    +
    +

    Objective-C Foundation types that are natively supported by Core Data managed attributes all conform to CoreDataNativeType.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +public protocol CoreDataNativeType : AnyObject, NSObjectProtocol
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    CoreStoreObjectiveCTypes are Objective-C accessible classes that represent CoreStore’s Swift types.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol CoreStoreObjectiveCType : AnyObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CoreStoreSwiftType + +
    +
    +
    +
    +
    +
    +

    CoreStoreSwiftTypes are CoreStore’s Swift types that are bridgeable to Objective-C.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol CoreStoreSwiftType
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CoreStoreLogger + +
    +
    +
    +
    +
    +
    +

    Custom loggers should implement the CoreStoreLogger protocol and pass its instance to CoreStore.logger. Calls to log(...), assert(...), and abort(...) are not tied to a specific queue/thread, so it is the implementer’s job to handle thread-safety.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol CoreStoreLogger
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Observation token for CoreStoreObject properties. Make sure to retain this instance to keep observing notifications.

    + +

    invalidate() will be called automatically when an CoreStoreObjectKeyValueObservation is deinited.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol CoreStoreObjectKeyValueObservation : AnyObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + DynamicObject + +
    +
    +
    +
    +
    +
    +

    All CoreStore’s utilities are designed around DynamicObject instances. NSManagedObject and CoreStoreObject instances all conform to DynamicObject.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol DynamicObject : AnyObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + DynamicKeyPath + +
    +
    +
    +
    +
    +
    +

    Used only for utility methods.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol DynamicKeyPath : AnyDynamicKeyPath
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + DynamicSchema + +
    +
    +
    +
    +
    +
    +

    DynamicSchema are types that provide NSManagedObjectModel instances for a single model version. CoreStore currently supports the following concrete types:

    + +
      +
    • XcodeDataModelSchema: describes models loaded from a .xcdatamodeld file.
    • +
    • UnsafeDataModelSchema: describes models loaded directly from an existing NSManagedObjectModel. It is not advisable to continue using this model as its metadata are not available to CoreStore.
    • +
    • CoreStoreSchema: describes models written for CoreStoreObject Swift class declarations.
    • +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol DynamicSchema
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Utility protocol for FetchChainBuilder. Used in fetch methods that support chained fetch builders.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol FetchChainableBuilderType
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + FetchableSource + +
    +
    +
    +
    +
    +
    +

    Encapsulates containers which manages an internal NSManagedObjectContext, such as DataStacks and transactions, that can be used for fetching objects. CoreStore provides implementations for this protocol and should be used as a read-only abstraction.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol FetchableSource : AnyObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + GroupByClause + +
    +
    +
    +
    +
    +
    +

    Abstracts the GroupBy clause for protocol utilities.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol GroupByClause
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ICloudStoreObserver + +
    +
    +
    +
    +
    +
    +

    Implement the ICloudStoreObserver protocol to observe ubiquitous storage notifications from the specified iCloud store. +Note that ICloudStoreObserver methods are only called when all the following conditions are true:

    + + + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, message: "Please see the release notes and Core Data documentation.")
    +public protocol ICloudStoreObserver : AnyObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Types supported by CoreStore as NSManagedObject and CoreStoreObject property types. +Supported default types:

    +
  • Bool
  • +
  • CGFloat
  • +
  • Data
  • +
    +

    Date

    + Date + +
    +
  • Double
  • +
  • Float
  • +
  • Int
  • +
  • Int8
  • +
  • Int16
  • +
  • Int32
  • +
  • Int64
  • +
  • NSData
  • +
  • NSDate
  • +
  • NSDecimalNumber
  • +
  • NSNumber
  • +
  • NSString
  • +
  • NSURL
  • +
  • NSUUID
  • +
  • String
  • +
  • URL
  • +
  • UUID
  • + +

    In addition, RawRepresentable types whose RawValue already implements ImportableAttributeType only need to declare conformance to ImportableAttributeType.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol ImportableAttributeType : QueryableAttributeType
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ImportableObject + +
    +
    +
    +
    +
    +
    +

    NSManagedObject and CoreStoreObject subclasses that conform to the ImportableObject protocol can be imported from a specified ImportSource. This allows transactions to create and insert instances this way:

    +
    class Person: NSManagedObject, ImportableObject {
    +    typealias ImportSource = NSDictionary
    +    // ...
    +}
    +
    +CoreStore.perform(
    +    asynchronous: { (transaction) -> Void in
    +        let json: NSDictionary = // ...
    +        let person = try transaction.importObject(
    +            Into<Person>(),
    +            source: json
    +        )
    +        // ...
    +    },
    +    completion: { (result) in
    +        // ...
    +    }
    +)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol ImportableObject : DynamicObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    NSManagedObject subclasses that conform to the ImportableUniqueObject protocol can be imported from a specified ImportSource. This allows transactions to either update existing objects or create new instances this way:

    +
    class Person: NSManagedObject, ImportableObject {
    +    typealias ImportSource = NSDictionary
    +    typealias UniqueIDType = NSString
    +    // ...
    +}
    +
    +CoreStore.perform(
    +    asynchronous: { (transaction) -> Void in
    +        let json: NSDictionary = // ...
    +        let person = try transaction.importUniqueObject(
    +            Into<Person>(),
    +            source: json
    +        )
    +        // ...
    +    },
    +    completion: { (result) in
    +        // ...
    +    }
    +)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol ImportableUniqueObject : ImportableObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ListObserver + +
    +
    +
    +
    +
    +
    +

    Implement the ListObserver protocol to observe changes to a list of NSManagedObjects. ListObservers may register themselves to a ListMonitor‘s addObserver(_:) method:

    +
    let monitor = CoreStore.monitorList(
    +    From<Person>(),
    +    OrderBy(.ascending("lastName"))
    +)
    +monitor.addObserver(self)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public protocol ListObserver : AnyObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ListObjectObserver + +
    +
    +
    +
    +
    +
    +

    Implement the ListObjectObserver protocol to observe detailed changes to a list’s object. ListObjectObservers may register themselves to a ListMonitor‘s addObserver(_:) method:

    +
    let monitor = CoreStore.monitorList(
    +    From<MyPersonEntity>(),
    +    OrderBy(.ascending("lastName"))
    +)
    +monitor.addObserver(self)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public protocol ListObjectObserver : ListObserver
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ListSectionObserver + +
    +
    +
    +
    +
    +
    +

    Implement the ListSectionObserver protocol to observe changes to a list’s section info. ListSectionObservers may register themselves to a ListMonitor‘s addObserver(_:) method:

    +
    let monitor = CoreStore.monitorSectionedList(
    +    From<MyPersonEntity>(),
    +    SectionBy("age") { "Age \($0)" },
    +    OrderBy(.ascending("lastName"))
    +)
    +monitor.addObserver(self)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public protocol ListSectionObserver : ListObjectObserver
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ObjectObserver + +
    +
    +
    +
    +
    +
    +

    Implement the ObjectObserver protocol to observe changes to a single DynamicObject instance. ObjectObservers may register themselves to a ObjectMonitor‘s addObserver(_:) method:

    +
    let monitor = CoreStore.monitorObject(object)
    +monitor.addObserver(self)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public protocol ObjectObserver : AnyObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + OrderByClause + +
    +
    +
    +
    +
    +
    +

    Abstracts the OrderBy clause for protocol utilities.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol OrderByClause
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Utility protocol for QueryChainBuilder. Used in fetch methods that support chained query builders.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol QueryChainableBuilderType
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Types supported by CoreStore for querying, especially as generic type for Select clauses. +Supported default types:

    + +
      +
    • Bool
    • +
    • CGFloat
    • +
    • Data
    • +
    • Date
    • +
    • Double
    • +
    • Float
    • +
    • Int
    • +
    • Int8
    • +
    • Int16
    • +
    • Int32
    • +
    • Int64
    • +
    • NSData
    • +
    • NSDate
    • +
    • NSDecimalNumber
    • +
    • NSManagedObjectID
    • +
    • NSNull
    • +
    • NSNumber
    • +
    • NSString
    • +
    • NSURL
    • +
    • NSUUID
    • +
    • String
    • +
    • URL
    • +
    • UUID
    • +
    + +

    In addition, RawRepresentable types whose RawValue already implements QueryableAttributeType only need to declare conformance to QueryableAttributeType.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol QueryableAttributeType : SelectResultType, Hashable
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + QueryableSource + +
    +
    +
    +
    +
    +
    +

    Encapsulates containers which manages an internal NSManagedObjectContext, such as DataStacks and transactions, that can be used for querying values. CoreStore provides implementations for this protocol and should be used as a read-only abstraction.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol QueryableSource : AnyObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + SchemaMappingProvider + +
    +
    +
    +
    +
    +
    +

    The SchemaMappingProvider provides migration mapping information between two DynamicSchema versions.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol SchemaMappingProvider
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + SelectResultType + +
    +
    +
    +
    +
    +
    +

    The SelectResultType protocol is implemented by return types supported by the Select clause.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol SelectResultType
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    The SelectAttributesResultType protocol is implemented by return types supported by the queryAttributes(...) methods.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol SelectAttributesResultType : SelectResultType
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + SelectClause + +
    +
    +
    +
    +
    +
    +

    Abstracts the Select clause for protocol utilities.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol SelectClause
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + StorageInterface + +
    +
    +
    +
    +
    +
    +

    The StorageInterface represents the data store managed (or to be managed) by the DataStack. When added to the DataStack, the StorageInterface serves as the interface for the NSPersistentStore. This may be a database file, an in-memory store, etc.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol StorageInterface : AnyObject
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ + +
+
+ +
    +
  • +
    + + + + FetchClause + +
    +
    +
    +
    +
    +
    +

    The FetchClause implement clauses used to configure NSFetchRequests.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol FetchClause
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + QueryClause + +
    +
    +
    +
    +
    +
    +

    The QueryClause implement clauses used to configure NSFetchRequests.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol QueryClause : FetchClause
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + DeleteClause + +
    +
    +
    +
    +
    +
    +

    The DeleteClause implement clauses used to configure NSFetchRequests.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol DeleteClause : FetchClause
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ + +
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/AnyWhereClause.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/AnyWhereClause.html new file mode 100644 index 0000000..18ef41c --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/AnyWhereClause.html @@ -0,0 +1,861 @@ + + + + AnyWhereClause Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

AnyWhereClause

+
+
+
public protocol AnyWhereClause : DeleteClause, QueryClause
+ +
+
+

Type-erased Where clause for protocol utilities.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + predicate + +
    +
    +
    +
    +
    +
    +

    The NSPredicate for the fetch or query

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var predicate: NSPredicate { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause with an NSPredicate

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    init(_ predicate: NSPredicate)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + predicate + + +
    +

    the NSPredicate for the fetch or query

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CSDynamicSchema.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CSDynamicSchema.html new file mode 100644 index 0000000..d505435 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CSDynamicSchema.html @@ -0,0 +1,850 @@ + + + + CSDynamicSchema Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSDynamicSchema

+
+
+
@objc
+public protocol CSDynamicSchema
+ +
+
+

The CSDynamicSchema serves as the Objective-C bridging type for DynamicSchema.

+
+

See also

+ DynamicSchema + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + modelVersion + +
    +
    +
    +
    +
    +
    +

    The version string for this model schema.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +var modelVersion: ModelVersion { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + rawModel() + +
    +
    +
    +
    +
    +
    +

    Do not call this directly. The NSManagedObjectModel for this schema may be created lazily and using this method directly may affect the integrity of the model.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +func rawModel() -> NSManagedObjectModel
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CSListObjectObserver.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CSListObjectObserver.html new file mode 100644 index 0000000..2b87092 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CSListObjectObserver.html @@ -0,0 +1,1096 @@ + + + + CSListObjectObserver Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSListObjectObserver

+
+
+
@available(OSX 10.12, *)
+@objc
+public protocol CSListObjectObserver : CSListObserver
+ +
+
+

Implement the CSListObjectObserver protocol to observe detailed changes to a list’s object. CSListObjectObservers may register themselves to a CSListMonitor‘s -addListObjectObserver(_:) method:

+
CSListMonitor *monitor = [CSCoreStore
+    monitorListFrom:[CSFrom entityClass:[MyPersonEntity class]]
+    fetchClauses:@[[CSOrderBy sortDescriptor:[CSSortKey withKeyPath:@"lastName" ascending:YES]]]];
+[monitor addListObjectObserver:self];
+
+
+

See also

+ ListObjectObserver + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Notifies that an object was inserted to the specified NSIndexPath in the list

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +optional func listMonitor(_ monitor: CSListMonitor, didInsertObject object: Any, toIndexPath indexPath: IndexPath)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + monitor + + +
    +

    the CSListMonitor monitoring the list being observed

    +
    +
    + + object + + +
    +

    the entity type for the inserted object

    +
    +
    + + indexPath + + +
    +

    the new NSIndexPath for the inserted object

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Notifies that an object was deleted from the specified NSIndexPath in the list

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +optional func listMonitor(_ monitor: CSListMonitor, didDeleteObject object: Any, fromIndexPath indexPath: IndexPath)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + monitor + + +
    +

    the CSListMonitor monitoring the list being observed

    +
    +
    + + object + + +
    +

    the entity type for the deleted object

    +
    +
    + + indexPath + + +
    +

    the NSIndexPath for the deleted object

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Notifies that an object at the specified NSIndexPath was updated

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +optional func listMonitor(_ monitor: CSListMonitor, didUpdateObject object: Any, atIndexPath indexPath: IndexPath)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + monitor + + +
    +

    the CSListMonitor monitoring the list being observed

    +
    +
    + + object + + +
    +

    the entity type for the updated object

    +
    +
    + + indexPath + + +
    +

    the NSIndexPath for the updated object

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Notifies that an object’s index changed

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +optional func listMonitor(_ monitor: CSListMonitor, didMoveObject object: Any, fromIndexPath: IndexPath, toIndexPath: IndexPath)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + monitor + + +
    +

    the CSListMonitor monitoring the list being observed

    +
    +
    + + object + + +
    +

    the entity type for the moved object

    +
    +
    + + fromIndexPath + + +
    +

    the previous NSIndexPath for the moved object

    +
    +
    + + toIndexPath + + +
    +

    the new NSIndexPath for the moved object

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CSListObserver.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CSListObserver.html new file mode 100644 index 0000000..1d54130 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CSListObserver.html @@ -0,0 +1,988 @@ + + + + CSListObserver Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSListObserver

+
+
+
@available(OSX 10.12, *)
+@objc
+public protocol CSListObserver : AnyObject
+ +
+
+

Implement the CSListObserver protocol to observe changes to a list of NSManagedObjects. CSListObservers may register themselves to a CSListMonitor‘s -addListObserver: method:

+
CSListMonitor *monitor = [CSCoreStore 
+    monitorListFrom:[CSFrom entityClass:[MyPersonEntity class]]
+    fetchClauses:@[[CSOrderBy sortDescriptor:[CSSortKey withKeyPath:@"lastName" ascending:YES]]]];
+[monitor addListObserver:self];
+
+
+

See also

+ ListObserver + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Handles processing just before a change to the observed list occurs

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +optional func listMonitorWillChange(_ monitor: CSListMonitor)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + monitor + + +
    +

    the CSListMonitor monitoring the list being observed

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Handles processing right after a change to the observed list occurs

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +optional func listMonitorDidChange(_ monitor: CSListMonitor)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + monitor + + +
    +

    the CSListMonitor monitoring the object being observed

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    This method is broadcast from within the CSListMonitor‘s -refetchWithFetchClauses: method to let observers prepare for the internal NSFetchedResultsController’s pending change to its predicate, sort descriptors, etc. Note that the actual refetch will happen after the NSFetchedResultsController’s last -controllerDidChangeContent: notification completes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +optional func listMonitorWillRefetch(_ monitor: CSListMonitor)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + monitor + + +
    +

    the CSListMonitor monitoring the object being observed

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    After the CSListMonitor‘s -refetchWithFetchClauses: method is called, this method is broadcast after the NSFetchedResultsController’s last -controllerDidChangeContent: notification completes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +optional func listMonitorDidRefetch(_ monitor: CSListMonitor)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + monitor + + +
    +

    the CSListMonitor monitoring the object being observed

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CSListSectionObserver.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CSListSectionObserver.html new file mode 100644 index 0000000..33904f8 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CSListSectionObserver.html @@ -0,0 +1,943 @@ + + + + CSListSectionObserver Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSListSectionObserver

+
+
+
@available(OSX 10.12, *)
+@objc
+public protocol CSListSectionObserver : CSListObjectObserver
+ +
+
+

Implement the CSListSectionObserver protocol to observe changes to a list’s section info. CSListSectionObservers may register themselves to a CSListMonitor‘s -addListSectionObserver: method:

+
CSListMonitor *monitor = [CSCoreStore
+    monitorSectionedListFrom:[CSFrom entityClass:[MyPersonEntity class]]
+    sectionBy:[CSSectionBy keyPath:@"age"]
+    fetchClauses:@[[CSOrderBy sortDescriptor:[CSSortKey withKeyPath:@"lastName" ascending:YES]]]];
+[monitor addListSectionObserver:self];
+
+
+

See also

+ ListSectionObserver + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Notifies that a section was inserted at the specified index

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +optional func listMonitor(_ monitor: CSListMonitor, didInsertSection sectionInfo: NSFetchedResultsSectionInfo, toSectionIndex sectionIndex: Int)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + monitor + + +
    +

    the CSListMonitor monitoring the list being observed

    +
    +
    + + sectionInfo + + +
    +

    the NSFetchedResultsSectionInfo for the inserted section

    +
    +
    + + sectionIndex + + +
    +

    the new section index for the new section

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Notifies that a section was inserted at the specified index

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +optional func listMonitor(_ monitor: CSListMonitor, didDeleteSection sectionInfo: NSFetchedResultsSectionInfo, fromSectionIndex sectionIndex: Int)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + monitor + + +
    +

    the CSListMonitor monitoring the list being observed

    +
    +
    + + sectionInfo + + +
    +

    the NSFetchedResultsSectionInfo for the deleted section

    +
    +
    + + sectionIndex + + +
    +

    the previous section index for the deleted section

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CSLocalStorage.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CSLocalStorage.html new file mode 100644 index 0000000..e4cd93e --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CSLocalStorage.html @@ -0,0 +1,906 @@ + + + + CSLocalStorage Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSLocalStorage

+
+
+
@objc
+public protocol CSLocalStorage : CSStorageInterface
+ +
+
+

The CSLocalStorage serves as the Objective-C bridging type for LocalStorage.

+
+

See also

+ LocalStorage + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + fileURL + +
    +
    +
    +
    +
    +
    +

    The NSURL that points to the store file

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +var fileURL: URL { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    An array of SchemaMappingProviders that provides the complete mapping models for custom migrations. This is currently only supported for Swift code.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +var migrationMappingProviders: [Any] { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + localStorageOptions + +
    +
    +
    +
    +
    +
    +

    Options that tell the CSDataStack how to setup the persistent store

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +var localStorageOptions: Int { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Called by the CSDataStack to perform actual deletion of the store file from disk. Do not call directly! The sourceModel argument is a hint for the existing store’s model version. Implementers can use the sourceModel to perform necessary store operations. (SQLite stores for example, can convert WAL journaling mode to DELETE before deleting)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +func cs_eraseStorageAndWait(metadata: NSDictionary, soureModelHint: NSManagedObjectModel?, error: NSErrorPointer) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CSObjectObserver.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CSObjectObserver.html new file mode 100644 index 0000000..283928a --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CSObjectObserver.html @@ -0,0 +1,987 @@ + + + + CSObjectObserver Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSObjectObserver

+
+
+
@available(OSX 10.12, *)
+@objc
+public protocol CSObjectObserver : AnyObject
+ +
+
+

Implement the CSObjectObserver protocol to observe changes to a single NSManagedObject instance. CSObjectObservers may register themselves to a CSObjectMonitor‘s -addObjectObserver: method:

+
CSObjectMonitor *monitor = [CSCoreStore monitorObject:myObject];
+[monitor addObjectObserver:self];
+
+
+

See also

+ ObjectObserver + +
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Handles processing just before a change to the observed object occurs

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +optional func objectMonitor(_ monitor: CSObjectMonitor, willUpdateObject object: Any)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + monitor + + +
    +

    the CSObjectMonitor monitoring the object being observed

    +
    +
    + + object + + +
    +

    the NSManagedObject instance being observed

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Handles processing right after a change to the observed object occurs

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +optional func objectMonitor(_ monitor: CSObjectMonitor, didUpdateObject object: Any, changedPersistentKeys: Set<String>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + monitor + + +
    +

    the CSObjectMonitor monitoring the object being observed

    +
    +
    + + object + + +
    +

    the NSManagedObject instance being observed

    +
    +
    + + changedPersistentKeys + + +
    +

    an NSSet of key paths for the attributes that were changed. Note that changedPersistentKeys only contains keys for attributes/relationships present in the persistent store, thus transient properties will not be reported.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Handles processing right after object is deleted

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +optional func objectMonitor(_ monitor: CSObjectMonitor, didDeleteObject object: Any)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + monitor + + +
    +

    the CSObjectMonitor monitoring the object being observed

    +
    +
    + + object + + +
    +

    the NSManagedObject instance being observed

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CSStorageInterface.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CSStorageInterface.html new file mode 100644 index 0000000..1814816 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CSStorageInterface.html @@ -0,0 +1,878 @@ + + + + CSStorageInterface Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CSStorageInterface

+
+
+
@objc
+public protocol CSStorageInterface
+ +
+
+

The CSStorageInterface serves as the Objective-C bridging type for StorageInterface.

+
+

See also

+ StorageInterface + +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + storeType + +
    +
    +
    +
    +
    +
    +

    The string identifier for the NSPersistentStore‘s type property. This is the same string CoreStore will use to create the NSPersistentStore from the NSPersistentStoreCoordinator’s addPersistentStoreWithType(...) method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +static var storeType: String { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    +

    The configuration name in the model file

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +var configuration: ModelConfiguration { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + storeOptions + +
    +
    +
    +
    +
    +
    +

    The options dictionary for the NSPersistentStore

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @objc
    +var storeOptions: [AnyHashable : Any]? { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CloudStorage.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CloudStorage.html new file mode 100644 index 0000000..3502291 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CloudStorage.html @@ -0,0 +1,896 @@ + + + + CloudStorage Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CloudStorage

+
+
+
public protocol CloudStorage : StorageInterface
+ +
+
+

The CloudStorage represents StorageInterfaces that are synchronized from a cloud-based store.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + cacheFileURL + +
    +
    +
    +
    +
    +
    +

    The NSURL that points to the store file

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var cacheFileURL: URL { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cloudStorageOptions + +
    +
    +
    +
    +
    +
    +

    Options that tell the DataStack how to setup the persistent store

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var cloudStorageOptions: CloudStorageOptions { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The options dictionary for the specified CloudStorageOptions

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func dictionary(forOptions options: CloudStorageOptions) -> [AnyHashable : Any]?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Called by the DataStack to perform actual deletion of the store file from disk. Do not call directly! The sourceModel argument is a hint for the existing store’s model version. Implementers can use the sourceModel to perform necessary store operations. (Cloud stores for example, can set the NSPersistentStoreRemoveUbiquitousMetadataOption option before deleting)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func cs_eraseStorageAndWait(soureModel: NSManagedObjectModel) throws
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CoreStoreLogger.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CoreStoreLogger.html new file mode 100644 index 0000000..dcd2243 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CoreStoreLogger.html @@ -0,0 +1,1164 @@ + + + + CoreStoreLogger Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CoreStoreLogger

+
+
+
public protocol CoreStoreLogger
+ +
+
+

Custom loggers should implement the CoreStoreLogger protocol and pass its instance to CoreStore.logger. Calls to log(...), assert(...), and abort(...) are not tied to a specific queue/thread, so it is the implementer’s job to handle thread-safety.

+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Handles log messages sent by the CoreStore framework.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func log(level: LogLevel, message: String, fileName: StaticString, lineNumber: Int, functionName: StaticString)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + +
    + + level + + +
    +

    the severity of the log message

    +
    +
    + + message + + +
    +

    the log message

    +
    +
    + + fileName + + +
    +

    the source file name

    +
    +
    + + lineNumber + + +
    +

    the source line number

    +
    +
    + + functionName + + +
    +

    the source function name

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Handles errors sent by the CoreStore framework.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func log(error: CoreStoreError, message: String, fileName: StaticString, lineNumber: Int, functionName: StaticString)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + +
    + + error + + +
    +

    the error

    +
    +
    + + message + + +
    +

    the error message

    +
    +
    + + fileName + + +
    +

    the source file name

    +
    +
    + + lineNumber + + +
    +

    the source line number

    +
    +
    + + functionName + + +
    +

    the source function name

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Handles assertions made throughout the CoreStore framework.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func assert(_ condition: @autoclosure () -> Bool, message: @autoclosure () -> String, fileName: StaticString, lineNumber: Int, functionName: StaticString)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + +
    + + condition + + +
    +

    the assertion condition

    +
    +
    + + message + + +
    +

    the assertion message

    +
    +
    + + fileName + + +
    +

    the source file name

    +
    +
    + + lineNumber + + +
    +

    the source line number

    +
    +
    + + functionName + + +
    +

    the source function name

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + abort(_:fileName:lineNumber:functionName:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Handles fatal errors made throughout the CoreStore framework. The app wil terminate after this method is called.

    +
    +

    Important

    +

    Implementers may guarantee that the function doesn’t return, either by calling another Never function such as fatalError() or abort(), or by raising an exception. If the implementation does not terminate the app, CoreStore will call an internal fatalError() to do so.

    + +
    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func abort(_ message: String, fileName: StaticString, lineNumber: Int, functionName: StaticString)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + message + + +
    +

    the fatal error message

    +
    +
    + + fileName + + +
    +

    the source file name

    +
    +
    + + lineNumber + + +
    +

    the source line number

    +
    +
    + + functionName + + +
    +

    the source function name

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CoreStoreObjectKeyValueObservation.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CoreStoreObjectKeyValueObservation.html new file mode 100644 index 0000000..86ec013 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CoreStoreObjectKeyValueObservation.html @@ -0,0 +1,817 @@ + + + + CoreStoreObjectKeyValueObservation Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CoreStoreObjectKeyValueObservation

+
+
+
public protocol CoreStoreObjectKeyValueObservation : AnyObject
+ +
+
+

Observation token for CoreStoreObject properties. Make sure to retain this instance to keep observing notifications.

+ +

invalidate() will be called automatically when an CoreStoreObjectKeyValueObservation is deinited.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + invalidate() + +
    +
    +
    +
    +
    +
    +

    invalidate() will be called automatically when an CoreStoreObjectKeyValueObservation is deinited.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func invalidate()
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CoreStoreObjectiveCType.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CoreStoreObjectiveCType.html new file mode 100644 index 0000000..f039fa7 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CoreStoreObjectiveCType.html @@ -0,0 +1,869 @@ + + + + CoreStoreObjectiveCType Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CoreStoreObjectiveCType

+
+
+
public protocol CoreStoreObjectiveCType : AnyObject
+ +
+
+

CoreStoreObjectiveCTypes are Objective-C accessible classes that represent CoreStore’s Swift types.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + SwiftType + +
    +
    +
    +
    +
    +
    +

    The corresponding Swift type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype SwiftType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + bridgeToSwift + +
    +
    +
    +
    +
    +
    +

    The bridged Swift instance

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var bridgeToSwift: SwiftType { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes this instance with the Swift instance to bridge from

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    init(_ swiftValue: SwiftType)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CoreStoreSwiftType.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CoreStoreSwiftType.html new file mode 100644 index 0000000..18b5cc1 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/CoreStoreSwiftType.html @@ -0,0 +1,842 @@ + + + + CoreStoreSwiftType Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CoreStoreSwiftType

+
+
+
public protocol CoreStoreSwiftType
+ +
+
+

CoreStoreSwiftTypes are CoreStore’s Swift types that are bridgeable to Objective-C.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + ObjectiveCType + +
    +
    +
    +
    +
    +
    +

    The corresponding Objective-C type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype ObjectiveCType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + bridgeToObjectiveC + +
    +
    +
    +
    +
    +
    +

    The bridged Objective-C instance

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var bridgeToObjectiveC: ObjectiveCType { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/DynamicKeyPath.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/DynamicKeyPath.html new file mode 100644 index 0000000..2cbd840 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/DynamicKeyPath.html @@ -0,0 +1,842 @@ + + + + DynamicKeyPath Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

DynamicKeyPath

+
+
+
public protocol DynamicKeyPath : AnyDynamicKeyPath
+ +
+
+

Used only for utility methods.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    +

    The DynamicObject type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype ObjectType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ValueType + +
    +
    +
    +
    +
    +
    +

    The Value type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype ValueType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/DynamicObject.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/DynamicObject.html new file mode 100644 index 0000000..a277383 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/DynamicObject.html @@ -0,0 +1,1121 @@ + + + + DynamicObject Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

DynamicObject

+
+
+
public protocol DynamicObject : AnyObject
+ +
+
+

All CoreStore’s utilities are designed around DynamicObject instances. NSManagedObject and CoreStoreObject instances all conform to DynamicObject.

+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Used internally by CoreStore. Do not call directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func cs_forceCreate(entityDescription: NSEntityDescription, into context: NSManagedObjectContext, assignTo store: NSPersistentStore) -> Self
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_fromRaw(object:) + +
    +
    +
    +
    +
    +
    +

    Used internally by CoreStore. Do not call directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func cs_fromRaw(object: NSManagedObject) -> Self
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_matches(object:) + +
    +
    +
    +
    +
    +
    +

    Used internally by CoreStore. Do not call directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func cs_matches(object: NSManagedObject) -> Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_id() + +
    +
    +
    +
    +
    +
    +

    Used internally by CoreStore. Do not call directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func cs_id() -> NSManagedObjectID
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cs_toRaw() + +
    +
    +
    +
    +
    +
    +

    Used internally by CoreStore. Do not call directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func cs_toRaw() -> NSManagedObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + partialObject() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the PartialObject instance for the object, which acts as a fast, type-safe KVC interface for CoreStoreObject.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func partialObject() -> PartialObject<Self>
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + Relationship + + + Extension method + +
    +
    +
    +
    +
    +
    +

    The containing type for relationships. Relationships can be any CoreStoreObject subclass.

    +
    class Dog: CoreStoreObject {
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let pets = Relationship.ToManyUnordered<Dog>("pets", inverse: { $0.master })
    +}
    +
    +
    +

    Important

    + Relationship properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Relationship = RelationshipContainer<Self>
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + Transformable + + + Extension method + +
    +
    +
    +
    +
    +
    +

    The containing type for transformable properties. Transformable properties support types that conforms to NSCoding & NSCopying.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let nickname = Value.Optional<String>("nickname")
    +    let color = Transformable.Optional<UIColor>("color")
    +}
    +
    +
    +

    Important

    + Transformable properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Transformable = TransformableContainer<Self>
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + Value + + + Extension method + +
    +
    +
    +
    +
    +
    +

    The containing type for value propertiess. Value properties support any type that conforms to ImportableAttributeType.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let nickname = Value.Optional<String>("nickname")
    +    let color = Transformable.Optional<UIColor>("color")
    +}
    +
    +
    +

    Important

    + Value properties are required to be stored properties. Computed properties will be ignored, including lazy and weak properties. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Value = ValueContainer<Self>
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/DynamicSchema.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/DynamicSchema.html new file mode 100644 index 0000000..07fae6b --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/DynamicSchema.html @@ -0,0 +1,898 @@ + + + + DynamicSchema Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

DynamicSchema

+
+
+
public protocol DynamicSchema
+ +
+
+

DynamicSchema are types that provide NSManagedObjectModel instances for a single model version. CoreStore currently supports the following concrete types:

+ +
    +
  • XcodeDataModelSchema: describes models loaded from a .xcdatamodeld file.
  • +
  • UnsafeDataModelSchema: describes models loaded directly from an existing NSManagedObjectModel. It is not advisable to continue using this model as its metadata are not available to CoreStore.
  • +
  • CoreStoreSchema: describes models written for CoreStoreObject Swift class declarations.
  • +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + modelVersion + +
    +
    +
    +
    +
    +
    +

    The version string for this model schema.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var modelVersion: ModelVersion { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + rawModel() + +
    +
    +
    +
    +
    +
    +

    Do not call this directly. The NSManagedObjectModel for this schema may be created lazily and using this method directly may affect the integrity of the model.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func rawModel() -> NSManagedObjectModel
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + printCoreStoreSchema() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Prints the DynamicSchema as their corresponding CoreStoreObject Swift declarations. This is useful for converting current XcodeDataModelSchema-based models into the new CoreStoreSchema framework. Additional adjustments may need to be done to the generated source code; for example: Transformable concrete types need to be provided, as well as default values.

    +
    +

    Important

    + After transitioning to the new CoreStoreSchema framework, it is recommended to add the new schema as a new version that the existing versions’ XcodeDataModelSchema can migrate to. It is discouraged to load existing SQLite files created with XcodeDataModelSchema directly into a CoreStoreSchema. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func printCoreStoreSchema() -> String
    + +
    +
    +
    +

    Return Value

    +

    a string that represents the source code for the DynamicSchema as their corresponding CoreStoreObject Swift declarations.

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/FetchChainableBuilderType.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/FetchChainableBuilderType.html new file mode 100644 index 0000000..27f07f5 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/FetchChainableBuilderType.html @@ -0,0 +1,869 @@ + + + + FetchChainableBuilderType Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

FetchChainableBuilderType

+
+
+
public protocol FetchChainableBuilderType
+ +
+
+

Utility protocol for FetchChainBuilder. Used in fetch methods that support chained fetch builders.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    +

    The DynamicObject type for the fetch

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype ObjectType : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + from + +
    +
    +
    +
    +
    +
    +

    The From clause specifies the source entity and source persistent store for the fetch

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var from: From<ObjectType> { get set }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchClauses + +
    +
    +
    +
    +
    +
    +

    The FetchClauses to be used for the fetch

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var fetchClauses: [FetchClause] { get set }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/FetchableSource.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/FetchableSource.html new file mode 100644 index 0000000..ee19f3e --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/FetchableSource.html @@ -0,0 +1,1915 @@ + + + + FetchableSource Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

FetchableSource

+
+
+
public protocol FetchableSource : AnyObject
+ +
+
+

Encapsulates containers which manages an internal NSManagedObjectContext, such as DataStacks and transactions, that can be used for fetching objects. CoreStore provides implementations for this protocol and should be used as a read-only abstraction.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the DynamicObject instance in the FetchableSource‘s context from a reference created from another managed object context.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchExisting<D>(_ object: D) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    a reference to the object created/fetched outside the FetchableSource‘s context

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject instance if the object exists in the FetchableSource‘s context, or nil if not found.

    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the DynamicObject instance in the FetchableSource‘s context from an NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchExisting<D>(_ objectID: NSManagedObjectID) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objectID + + +
    +

    the NSManagedObjectID for the object

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject instance if the object exists in the FetchableSource, or nil if not found.

    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the DynamicObject instances in the FetchableSource‘s context from references created from another managed object context.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchExisting<D, S>(_ objects: S) -> [D] where D : DynamicObject, D == S.Element, S : Sequence
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objects + + +
    +

    an array of DynamicObjects created/fetched outside the FetchableSource‘s context

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject array for objects that exists in the FetchableSource

    +
    +
    +
    +
  • +
  • +
    + + + + fetchExisting(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the DynamicObject instances in the FetchableSource‘s context from a list of NSManagedObjectID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchExisting<D, S>(_ objectIDs: S) -> [D] where D : DynamicObject, S : Sequence, S.Element == NSManagedObjectID
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objectIDs + + +
    +

    the NSManagedObjectID array for the objects

    +
    +
    +
    +
    +

    Return Value

    +

    the DynamicObject array for objects that exists in the FetchableSource‘s context

    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the first DynamicObject instance that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchOne<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the first DynamicObject instance that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the first DynamicObject instance that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchOne<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> D? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the first DynamicObject instance that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchOne(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the first DynamicObject instance that satisfies the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let youngestTeen = source.fetchOne(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchOne<B>(_ clauseChain: B) -> B.ObjectType? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the first DynamicObject instance that satisfies the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches all DynamicObject instances that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchAll<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> [D]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    all DynamicObject instances that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches all DynamicObject instances that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchAll<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> [D]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    all DynamicObject instances that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchAll(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches all DynamicObject instances that satisfy the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let people = source.fetchAll(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchAll<B>(_ clauseChain: B) -> [B.ObjectType]? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    all DynamicObject instances that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the number of DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchCount<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> Int? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the number DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the number of DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchCount<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> Int? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the number DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchCount(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the number of DynamicObjects that satisfy the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let numberOfAdults = source.fetchCount(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchCount<B>(_ clauseChain: B) -> Int? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the number DynamicObjects that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> NSManagedObjectID? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> NSManagedObjectID? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectID(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let youngestTeenID = source.fetchObjectID(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchObjectID<B>(_ clauseChain: B) -> NSManagedObjectID? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for the first DynamicObject that satisfies the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: FetchClause...) -> [NSManagedObjectID]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses. Accepts Where, OrderBy, and Tweak clauses.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) -> [NSManagedObjectID]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + fetchClauses + + +
    +

    a series of FetchClause instances for the fetch request. Accepts Where, OrderBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchClauses

    +
    +
    +
    +
  • +
  • +
    + + + + fetchObjectIDs(_:) + +
    +
    +
    +
    +
    +
    +

    Fetches the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchChainableBuilderType built from a chain of clauses.

    +
    let idsOfAdults = source.fetchObjectIDs(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchObjectIDs<B>(_ clauseChain: B) -> [NSManagedObjectID]? where B : FetchChainableBuilderType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a FetchChainableBuilderType built from a chain of clauses

    +
    +
    +
    +
    +

    Return Value

    +

    the NSManagedObjectID for all DynamicObjects that satisfy the specified FetchChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + unsafeContext() + +
    +
    +
    +
    +
    +
    +

    The internal NSManagedObjectContext managed by this FetchableSource. Using this context directly should typically be avoided, and is provided by CoreStore only for extremely specialized cases.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func unsafeContext() -> NSManagedObjectContext
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/GroupByClause.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/GroupByClause.html new file mode 100644 index 0000000..725f199 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/GroupByClause.html @@ -0,0 +1,842 @@ + + + + GroupByClause Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

GroupByClause

+
+
+
public protocol GroupByClause
+ +
+
+

Abstracts the GroupBy clause for protocol utilities.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    +

    The DynamicObject type associated with the clause

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype ObjectType : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + keyPaths + +
    +
    +
    +
    +
    +
    +

    The list of key path strings to group results with

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var keyPaths: [KeyPathString] { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/ICloudStoreObserver.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/ICloudStoreObserver.html new file mode 100644 index 0000000..53afa24 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/ICloudStoreObserver.html @@ -0,0 +1,1316 @@ + + + + ICloudStoreObserver Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ICloudStoreObserver

+
+
+
@available(*, deprecated, message: "Please see the release notes and Core Data documentation.")
+public protocol ICloudStoreObserver : AnyObject
+ +
+
+

Implement the ICloudStoreObserver protocol to observe ubiquitous storage notifications from the specified iCloud store. +Note that ICloudStoreObserver methods are only called when all the following conditions are true:

+ + + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Notifies that the initial ubiquitous store import will complete

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func iCloudStoreWillFinishUbiquitousStoreInitialImport(storage: ICloudStore, dataStack: DataStack)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the ICloudStore instance being observed

    +
    +
    + + dataStack + + +
    +

    the DataStack that manages the peristent store

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Notifies that the initial ubiquitous store import completed

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func iCloudStoreDidFinishUbiquitousStoreInitialImport(storage: ICloudStore, dataStack: DataStack)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the ICloudStore instance being observed

    +
    +
    + + dataStack + + +
    +

    the DataStack that manages the peristent store

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + iCloudStoreWillAddAccount(storage:dataStack:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies that an iCloud account will be added to the coordinator

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func iCloudStoreWillAddAccount(storage: ICloudStore, dataStack: DataStack)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the ICloudStore instance being observed

    +
    +
    + + dataStack + + +
    +

    the DataStack that manages the peristent store

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + iCloudStoreDidAddAccount(storage:dataStack:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies that an iCloud account was added to the coordinator

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func iCloudStoreDidAddAccount(storage: ICloudStore, dataStack: DataStack)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the ICloudStore instance being observed

    +
    +
    + + dataStack + + +
    +

    the DataStack that manages the peristent store

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + iCloudStoreWillRemoveAccount(storage:dataStack:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies that an iCloud account will be removed from the coordinator

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func iCloudStoreWillRemoveAccount(storage: ICloudStore, dataStack: DataStack)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the ICloudStore instance being observed

    +
    +
    + + dataStack + + +
    +

    the DataStack that manages the peristent store

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + iCloudStoreDidRemoveAccount(storage:dataStack:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies that an iCloud account was removed from the coordinator

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func iCloudStoreDidRemoveAccount(storage: ICloudStore, dataStack: DataStack)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the ICloudStore instance being observed

    +
    +
    + + dataStack + + +
    +

    the DataStack that manages the peristent store

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + iCloudStoreWillRemoveContent(storage:dataStack:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies that iCloud contents will be deleted

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func iCloudStoreWillRemoveContent(storage: ICloudStore, dataStack: DataStack)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the ICloudStore instance being observed

    +
    +
    + + dataStack + + +
    +

    the DataStack that manages the peristent store

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + iCloudStoreDidRemoveContent(storage:dataStack:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies that iCloud contents were deleted

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func iCloudStoreDidRemoveContent(storage: ICloudStore, dataStack: DataStack)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + storage + + +
    +

    the ICloudStore instance being observed

    +
    +
    + + dataStack + + +
    +

    the DataStack that manages the peristent store

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/ImportableObject.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/ImportableObject.html new file mode 100644 index 0000000..a848919 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/ImportableObject.html @@ -0,0 +1,961 @@ + + + + ImportableObject Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ImportableObject

+
+
+
public protocol ImportableObject : DynamicObject
+ +
+
+

NSManagedObject and CoreStoreObject subclasses that conform to the ImportableObject protocol can be imported from a specified ImportSource. This allows transactions to create and insert instances this way:

+
class Person: NSManagedObject, ImportableObject {
+    typealias ImportSource = NSDictionary
+    // ...
+}
+
+CoreStore.perform(
+    asynchronous: { (transaction) -> Void in
+        let json: NSDictionary = // ...
+        let person = try transaction.importObject(
+            Into<Person>(),
+            source: json
+        )
+        // ...
+    },
+    completion: { (result) in
+        // ...
+    }
+)
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + ImportSource + +
    +
    +
    +
    +
    +
    +

    The data type for the import source. This is most commonly an json type, NSDictionary, or another external source such as NSUserDefaults.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype ImportSource
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + shouldInsert(from:in:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Return true if an object should be created from source. Return false to ignore and skip source. The default implementation returns true.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func shouldInsert(from source: ImportSource, in transaction: BaseDataTransaction) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + source + + +
    +

    the object to import from

    +
    +
    + + transaction + + +
    +

    the transaction that invoked the import. Use the transaction to fetch or create related objects if needed.

    +
    +
    +
    +
    +

    Return Value

    +

    true if an object should be created from source. Return false to ignore.

    +
    +
    +
    +
  • +
  • +
    + + + + didInsert(from:in:) + +
    +
    +
    +
    +
    +
    +

    Implements the actual importing of data from source. Implementers should pull values from source and assign them to the receiver’s attributes. Note that throwing from this method will cause subsequent imports that are part of the same importObjects(:sourceArray:) call to be cancelled.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func didInsert(from source: ImportSource, in transaction: BaseDataTransaction) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + source + + +
    +

    the object to import from

    +
    +
    + + transaction + + +
    +

    the transaction that invoked the import. Use the transaction to fetch or create related objects if needed.

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/ImportableUniqueObject.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/ImportableUniqueObject.html new file mode 100644 index 0000000..02ff3b7 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/ImportableUniqueObject.html @@ -0,0 +1,1210 @@ + + + + ImportableUniqueObject Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ImportableUniqueObject

+
+
+
public protocol ImportableUniqueObject : ImportableObject
+ +
+
+

NSManagedObject subclasses that conform to the ImportableUniqueObject protocol can be imported from a specified ImportSource. This allows transactions to either update existing objects or create new instances this way:

+
class Person: NSManagedObject, ImportableObject {
+    typealias ImportSource = NSDictionary
+    typealias UniqueIDType = NSString
+    // ...
+}
+
+CoreStore.perform(
+    asynchronous: { (transaction) -> Void in
+        let json: NSDictionary = // ...
+        let person = try transaction.importUniqueObject(
+            Into<Person>(),
+            source: json
+        )
+        // ...
+    },
+    completion: { (result) in
+        // ...
+    }
+)
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + UniqueIDType + +
    +
    +
    +
    +
    +
    +

    The data type for the entity’s unique ID attribute

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype UniqueIDType : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + uniqueIDKeyPath + +
    +
    +
    +
    +
    +
    +

    The keyPath to the entity’s unique ID attribute

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var uniqueIDKeyPath: String { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + uniqueIDValue + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    The object’s unique ID value. The default implementation returns the value of the attribute pertained to by uniqueIDKeyPath

    +
    +

    Important

    + It is the developer’s responsibility to ensure that the attribute value pertained by uniqueIDKeyPath is not nil during the call to uniqueIDValue. + +
    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var uniqueIDValue: UniqueIDType { get set }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Return true if an object should be created from source. Return false to ignore and skip source. The default implementation returns the value returned by the shouldUpdate(from:in:) implementation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func shouldInsert(from source: ImportSource, in transaction: BaseDataTransaction) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + source + + +
    +

    the object to import from

    +
    +
    + + transaction + + +
    +

    the transaction that invoked the import. Use the transaction to fetch or create related objects if needed.

    +
    +
    +
    +
    +

    Return Value

    +

    true if an object should be created from source. Return false to ignore.

    +
    +
    +
    +
  • +
  • +
    + + + + shouldUpdate(from:in:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Return true if an object should be updated from source. Return false to ignore and skip source. The default implementation returns true.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func shouldUpdate(from source: ImportSource, in transaction: BaseDataTransaction) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + source + + +
    +

    the object to import from

    +
    +
    + + transaction + + +
    +

    the transaction that invoked the import. Use the transaction to fetch or create related objects if needed.

    +
    +
    +
    +
    +

    Return Value

    +

    true if an object should be updated from source. Return false to ignore.

    +
    +
    +
    +
  • +
  • +
    + + + + uniqueID(from:in:) + +
    +
    +
    +
    +
    +
    +

    Return the unique ID as extracted from source. This method is called before shouldInsert(from:in:) or shouldUpdate(from:in:). Return nil to skip importing from source. Note that throwing from this method will cause subsequent imports that are part of the same importUniqueObjects(:sourceArray:) call to be cancelled.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func uniqueID(from source: ImportSource, in transaction: BaseDataTransaction) throws -> UniqueIDType?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + source + + +
    +

    the object to import from

    +
    +
    + + transaction + + +
    +

    the transaction that invoked the import. Use the transaction to fetch or create related objects if needed.

    +
    +
    +
    +
    +

    Return Value

    +

    the unique ID as extracted from source, or nil to skip importing from source.

    +
    +
    +
    +
  • +
  • +
    + + + + didInsert(from:in:) + +
    +
    +
    +
    +
    +
    +

    Implements the actual importing of data from source. This method is called just after the object is created and assigned its unique ID as returned from uniqueID(from:in:). Implementers should pull values from source and assign them to the receiver’s attributes. Note that throwing from this method will cause subsequent imports that are part of the same importUniqueObjects(:sourceArray:) call to be cancelled. The default implementation simply calls update(from:in:).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func didInsert(from source: ImportSource, in transaction: BaseDataTransaction) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + source + + +
    +

    the object to import from

    +
    +
    + + transaction + + +
    +

    the transaction that invoked the import. Use the transaction to fetch or create related objects if needed.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + update(from:in:) + +
    +
    +
    +
    +
    +
    +

    Implements the actual importing of data from source. This method is called just after the existing object is fetched using its unique ID. Implementers should pull values from source and assign them to the receiver’s attributes. Note that throwing from this method will cause subsequent imports that are part of the same importUniqueObjects(:sourceArray:) call to be cancelled.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func update(from source: ImportSource, in transaction: BaseDataTransaction) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + source + + +
    +

    the object to import from

    +
    +
    + + transaction + + +
    +

    the transaction that invoked the import. Use the transaction to fetch or create related objects if needed.

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/ListObjectObserver.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/ListObjectObserver.html new file mode 100644 index 0000000..af1cd4b --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/ListObjectObserver.html @@ -0,0 +1,1119 @@ + + + + ListObjectObserver Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ListObjectObserver

+
+
+
@available(OSX 10.12, *)
+public protocol ListObjectObserver : ListObserver
+ +
+
+

Implement the ListObjectObserver protocol to observe detailed changes to a list’s object. ListObjectObservers may register themselves to a ListMonitor‘s addObserver(_:) method:

+
let monitor = CoreStore.monitorList(
+    From<MyPersonEntity>(),
+    OrderBy(.ascending("lastName"))
+)
+monitor.addObserver(self)
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + listMonitor(_:didInsertObject:toIndexPath:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies that an object was inserted to the specified NSIndexPath in the list. (Optional) +The default implementation does nothing.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func listMonitor(_ monitor: ListMonitor<ListEntityType>, didInsertObject object: ListEntityType, toIndexPath indexPath: IndexPath)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + monitor + + +
    +

    the ListMonitor monitoring the list being observed

    +
    +
    + + object + + +
    +

    the entity type for the inserted object

    +
    +
    + + indexPath + + +
    +

    the new NSIndexPath for the inserted object

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + listMonitor(_:didDeleteObject:fromIndexPath:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies that an object was deleted from the specified NSIndexPath in the list. (Optional) +The default implementation does nothing.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func listMonitor(_ monitor: ListMonitor<ListEntityType>, didDeleteObject object: ListEntityType, fromIndexPath indexPath: IndexPath)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + monitor + + +
    +

    the ListMonitor monitoring the list being observed

    +
    +
    + + object + + +
    +

    the entity type for the deleted object

    +
    +
    + + indexPath + + +
    +

    the NSIndexPath for the deleted object

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + listMonitor(_:didUpdateObject:atIndexPath:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies that an object at the specified NSIndexPath was updated. (Optional) +The default implementation does nothing.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func listMonitor(_ monitor: ListMonitor<ListEntityType>, didUpdateObject object: ListEntityType, atIndexPath indexPath: IndexPath)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + monitor + + +
    +

    the ListMonitor monitoring the list being observed

    +
    +
    + + object + + +
    +

    the entity type for the updated object

    +
    +
    + + indexPath + + +
    +

    the NSIndexPath for the updated object

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + listMonitor(_:didMoveObject:fromIndexPath:toIndexPath:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies that an object’s index changed. (Optional) +The default implementation does nothing.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func listMonitor(_ monitor: ListMonitor<ListEntityType>, didMoveObject object: ListEntityType, fromIndexPath: IndexPath, toIndexPath: IndexPath)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + monitor + + +
    +

    the ListMonitor monitoring the list being observed

    +
    +
    + + object + + +
    +

    the entity type for the moved object

    +
    +
    + + fromIndexPath + + +
    +

    the previous NSIndexPath for the moved object

    +
    +
    + + toIndexPath + + +
    +

    the new NSIndexPath for the moved object

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/ListObserver.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/ListObserver.html new file mode 100644 index 0000000..99aa35d --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/ListObserver.html @@ -0,0 +1,1031 @@ + + + + ListObserver Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ListObserver

+
+
+
@available(OSX 10.12, *)
+public protocol ListObserver : AnyObject
+ +
+
+

Implement the ListObserver protocol to observe changes to a list of NSManagedObjects. ListObservers may register themselves to a ListMonitor‘s addObserver(_:) method:

+
let monitor = CoreStore.monitorList(
+    From<Person>(),
+    OrderBy(.ascending("lastName"))
+)
+monitor.addObserver(self)
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + ListEntityType + +
    +
    +
    +
    +
    +
    +

    The NSManagedObject type for the observed list

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype ListEntityType : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + listMonitorWillChange(_:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Handles processing just before a change to the observed list occurs. (Optional) +The default implementation does nothing.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func listMonitorWillChange(_ monitor: ListMonitor<ListEntityType>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + monitor + + +
    +

    the ListMonitor monitoring the list being observed

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Handles processing right after a change to the observed list occurs. (Required)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func listMonitorDidChange(_ monitor: ListMonitor<ListEntityType>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + monitor + + +
    +

    the ListMonitor monitoring the object being observed

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + listMonitorWillRefetch(_:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    This method is broadcast from within the ListMonitor‘s refetch(...) method to let observers prepare for the internal NSFetchedResultsController’s pending change to its predicate, sort descriptors, etc. (Optional)

    +
    +

    Important

    + All ListMonitor access between listMonitorWillRefetch(_:) and listMonitorDidRefetch(_:) will raise and assertion. The actual refetch will happen after the NSFetchedResultsController’s last controllerDidChangeContent(_:) notification completes. + +
    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func listMonitorWillRefetch(_ monitor: ListMonitor<ListEntityType>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + monitor + + +
    +

    the ListMonitor monitoring the object being observed

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    After the ListMonitor‘s refetch(...) method is called, this method is broadcast after the NSFetchedResultsController’s last controllerDidChangeContent(_:) notification completes. (Required)

    +
    +

    Important

    + When listMonitorDidRefetch(_:) is called it should be assumed that all ListMonitor’s previous data have been reset, including counts, objects, and persistent stores. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func listMonitorDidRefetch(_ monitor: ListMonitor<ListEntityType>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + monitor + + +
    +

    the ListMonitor monitoring the object being observed

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/ListSectionObserver.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/ListSectionObserver.html new file mode 100644 index 0000000..606d8c0 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/ListSectionObserver.html @@ -0,0 +1,952 @@ + + + + ListSectionObserver Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ListSectionObserver

+
+
+
@available(OSX 10.12, *)
+public protocol ListSectionObserver : ListObjectObserver
+ +
+
+

Implement the ListSectionObserver protocol to observe changes to a list’s section info. ListSectionObservers may register themselves to a ListMonitor‘s addObserver(_:) method:

+
let monitor = CoreStore.monitorSectionedList(
+    From<MyPersonEntity>(),
+    SectionBy("age") { "Age \($0)" },
+    OrderBy(.ascending("lastName"))
+)
+monitor.addObserver(self)
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + listMonitor(_:didInsertSection:toSectionIndex:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies that a section was inserted at the specified index. (Optional) +The default implementation does nothing.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func listMonitor(_ monitor: ListMonitor<ListEntityType>, didInsertSection sectionInfo: NSFetchedResultsSectionInfo, toSectionIndex sectionIndex: Int)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + monitor + + +
    +

    the ListMonitor monitoring the list being observed

    +
    +
    + + sectionInfo + + +
    +

    the NSFetchedResultsSectionInfo for the inserted section

    +
    +
    + + sectionIndex + + +
    +

    the new section index for the new section

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + listMonitor(_:didDeleteSection:fromSectionIndex:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies that a section was inserted at the specified index. (Optional) +The default implementation does nothing.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func listMonitor(_ monitor: ListMonitor<ListEntityType>, didDeleteSection sectionInfo: NSFetchedResultsSectionInfo, fromSectionIndex sectionIndex: Int)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + monitor + + +
    +

    the ListMonitor monitoring the list being observed

    +
    +
    + + sectionInfo + + +
    +

    the NSFetchedResultsSectionInfo for the deleted section

    +
    +
    + + sectionIndex + + +
    +

    the previous section index for the deleted section

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/LocalStorage.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/LocalStorage.html new file mode 100644 index 0000000..3295b3e --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/LocalStorage.html @@ -0,0 +1,950 @@ + + + + LocalStorage Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

LocalStorage

+
+
+
public protocol LocalStorage : StorageInterface
+ +
+
+

The LocalStorage represents StorageInterfaces that are backed by local files.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + fileURL + +
    +
    +
    +
    +
    +
    +

    The NSURL that points to the store file

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var fileURL: URL { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    An array of SchemaMappingProviders that provide the complete mapping models for custom migrations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var migrationMappingProviders: [SchemaMappingProvider] { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + localStorageOptions + +
    +
    +
    +
    +
    +
    +

    Options that tell the DataStack how to setup the persistent store

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var localStorageOptions: LocalStorageOptions { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The options dictionary for the specified LocalStorageOptions

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func dictionary(forOptions options: LocalStorageOptions) -> [AnyHashable : Any]?
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Called by the DataStack to perform checkpoint operations on the storage. (SQLite stores for example, can convert the database’s WAL journaling mode to DELETE to force a checkpoint)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func cs_finalizeStorageAndWait(soureModelHint: NSManagedObjectModel) throws
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Called by the DataStack to perform actual deletion of the store file from disk. Do not call directly! The sourceModel argument is a hint for the existing store’s model version. Implementers can use the sourceModel to perform necessary store operations. (SQLite stores for example, can convert WAL journaling mode to DELETE before deleting)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func cs_eraseStorageAndWait(metadata: [String : Any], soureModelHint: NSManagedObjectModel?) throws
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/ObjectObserver.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/ObjectObserver.html new file mode 100644 index 0000000..5a81e10 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/ObjectObserver.html @@ -0,0 +1,1029 @@ + + + + ObjectObserver Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ObjectObserver

+
+
+
@available(OSX 10.12, *)
+public protocol ObjectObserver : AnyObject
+ +
+
+

Implement the ObjectObserver protocol to observe changes to a single DynamicObject instance. ObjectObservers may register themselves to a ObjectMonitor‘s addObserver(_:) method:

+
let monitor = CoreStore.monitorObject(object)
+monitor.addObserver(self)
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + ObjectEntityType + +
    +
    +
    +
    +
    +
    +

    The DynamicObject type for the observed object

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype ObjectEntityType : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + objectMonitor(_:willUpdateObject:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Handles processing just before a change to the observed object occurs. (Optional) +The default implementation does nothing.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func objectMonitor(_ monitor: ObjectMonitor<ObjectEntityType>, willUpdateObject object: ObjectEntityType)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + monitor + + +
    +

    the ObjectMonitor monitoring the object being observed

    +
    +
    + + object + + +
    +

    the DynamicObject instance being observed

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + objectMonitor(_:didUpdateObject:changedPersistentKeys:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Handles processing right after a change to the observed object occurs. (Optional) +The default implementation does nothing.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func objectMonitor(_ monitor: ObjectMonitor<ObjectEntityType>, didUpdateObject object: ObjectEntityType, changedPersistentKeys: Set<KeyPathString>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + monitor + + +
    +

    the ObjectMonitor monitoring the object being observed

    +
    +
    + + object + + +
    +

    the DynamicObject instance being observed

    +
    +
    + + changedPersistentKeys + + +
    +

    a Set of key paths for the attributes that were changed. Note that changedPersistentKeys only contains keys for attributes/relationships present in the persistent store, thus transient properties will not be reported.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + objectMonitor(_:didDeleteObject:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Handles processing right after object is deleted. (Optional) +The default implementation does nothing.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func objectMonitor(_ monitor: ObjectMonitor<ObjectEntityType>, didDeleteObject object: ObjectEntityType)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + monitor + + +
    +

    the ObjectMonitor monitoring the object being observed

    +
    +
    + + object + + +
    +

    the DynamicObject instance being observed

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/OrderByClause.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/OrderByClause.html new file mode 100644 index 0000000..d91b69e --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/OrderByClause.html @@ -0,0 +1,842 @@ + + + + OrderByClause Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

OrderByClause

+
+
+
public protocol OrderByClause
+ +
+
+

Abstracts the OrderBy clause for protocol utilities.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    +

    The DynamicObject type associated with the clause

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype ObjectType : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + sortDescriptors + +
    +
    +
    +
    +
    +
    +

    The NSSortDescriptor array for the fetch or query

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var sortDescriptors: [NSSortDescriptor] { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/QueryChainableBuilderType.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/QueryChainableBuilderType.html new file mode 100644 index 0000000..7dceae9 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/QueryChainableBuilderType.html @@ -0,0 +1,923 @@ + + + + QueryChainableBuilderType Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

QueryChainableBuilderType

+
+
+
public protocol QueryChainableBuilderType
+ +
+
+

Utility protocol for QueryChainBuilder. Used in fetch methods that support chained query builders.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    +

    The DynamicObject type for the query

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype ObjectType : DynamicObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ResultType + +
    +
    +
    +
    +
    +
    +

    The SelectResultType type for the query

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype ResultType : SelectResultType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + from + +
    +
    +
    +
    +
    +
    +

    The From clause specifies the source entity and source persistent store for the query

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var from: From<ObjectType> { get set }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + select + +
    +
    +
    +
    +
    +
    +

    The Select clause to be used for the query

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var select: Select<ObjectType, ResultType> { get set }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + queryClauses + +
    +
    +
    +
    +
    +
    +

    The QueryClauses to be used for the query

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var queryClauses: [QueryClause] { get set }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/QueryableAttributeType.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/QueryableAttributeType.html new file mode 100644 index 0000000..86736d3 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/QueryableAttributeType.html @@ -0,0 +1,927 @@ + + + + QueryableAttributeType Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

QueryableAttributeType

+
+
+
public protocol QueryableAttributeType : SelectResultType, Hashable
+ +
+
+

Types supported by CoreStore for querying, especially as generic type for Select clauses. +Supported default types:

+ +
    +
  • Bool
  • +
  • CGFloat
  • +
  • Data
  • +
  • Date
  • +
  • Double
  • +
  • Float
  • +
  • Int
  • +
  • Int8
  • +
  • Int16
  • +
  • Int32
  • +
  • Int64
  • +
  • NSData
  • +
  • NSDate
  • +
  • NSDecimalNumber
  • +
  • NSManagedObjectID
  • +
  • NSNull
  • +
  • NSNumber
  • +
  • NSString
  • +
  • NSURL
  • +
  • NSUUID
  • +
  • String
  • +
  • URL
  • +
  • UUID
  • +
+ +

In addition, RawRepresentable types whose RawValue already implements QueryableAttributeType only need to declare conformance to QueryableAttributeType.

+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/QueryableSource.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/QueryableSource.html new file mode 100644 index 0000000..289c636 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/QueryableSource.html @@ -0,0 +1,1244 @@ + + + + QueryableSource Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

QueryableSource

+
+
+
public protocol QueryableSource : AnyObject
+ +
+
+

Encapsulates containers which manages an internal NSManagedObjectContext, such as DataStacks and transactions, that can be used for querying values. CoreStore provides implementations for this protocol and should be used as a read-only abstraction.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + queryValue(_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Queries aggregate values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func queryValue<D, U>(_ from: From<D>, _ selectClause: Select<D, U>, _ queryClauses: QueryClause...) -> U? where D : DynamicObject, U : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • +
    + + + + queryValue(_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Queries aggregate values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func queryValue<D, U>(_ from: From<D>, _ selectClause: Select<D, U>, _ queryClauses: [QueryClause]) -> U? where D : DynamicObject, U : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • +
    + + + + queryValue(_:) + +
    +
    +
    +
    +
    +
    +

    Queries a property value or aggregate as specified by the QueryChainableBuilderType built from a chain of clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    +
    let averageAdultAge = dataStack.queryValue(
    +    From<MyPersonEntity>()
    +        .select(Int.self, .average(\.age))
    +        .where(\.age > 18)
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func queryValue<B>(_ clauseChain: B) -> B.ResultType? where B : QueryChainableBuilderType, B.ResultType : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a QueryChainableBuilderType indicating the property/aggregate to fetch and the series of queries for the request.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query as specified by the QueryChainableBuilderType

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Queries a dictionary of attribute values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func queryAttributes<D>(_ from: From<D>, _ selectClause: Select<D, NSDictionary>, _ queryClauses: QueryClause...) -> [[String : Any]]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Queries a dictionary of attribute values as specified by the QueryClauses. Requires at least a Select clause, and optional Where, OrderBy, GroupBy, and Tweak clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func queryAttributes<D>(_ from: From<D>, _ selectClause: Select<D, NSDictionary>, _ queryClauses: [QueryClause]) -> [[String : Any]]? where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + from + + +
    +

    a From clause indicating the entity type

    +
    +
    + + selectClause + + +
    +

    a Select<U> clause indicating the properties to fetch, and with the generic type indicating the return type.

    +
    +
    + + queryClauses + + +
    +

    a series of QueryClause instances for the query request. Accepts Where, OrderBy, GroupBy, and Tweak clauses.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query. The type of the return value is specified by the generic type of the Select<U> parameter.

    +
    +
    +
    +
  • +
  • +
    + + + + queryAttributes(_:) + +
    +
    +
    +
    +
    +
    +

    Queries a dictionary of attribute values or as specified by the QueryChainableBuilderType built from a chain of clauses.

    + +

    A query differs from a fetch in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.

    +
    let results = source.queryAttributes(
    +    From<MyPersonEntity>()
    +        .select(
    +            NSDictionary.self,
    +            .attribute(\.age, as: "age"),
    +            .count(\.age, as: "numberOfPeople")
    +        )
    +        .groupBy(\.age)
    +)
    +for dictionary in results! {
    +    let age = dictionary["age"] as! Int
    +    let count = dictionary["numberOfPeople"] as! Int
    +    print("There are \(count) people who are \(age) years old."
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func queryAttributes<B>(_ clauseChain: B) -> [[String : Any]]? where B : QueryChainableBuilderType, B.ResultType == NSDictionary
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauseChain + + +
    +

    a QueryChainableBuilderType indicating the properties to fetch and the series of queries for the request.

    +
    +
    +
    +
    +

    Return Value

    +

    the result of the the query as specified by the QueryChainableBuilderType

    +
    +
    +
    +
  • +
  • +
    + + + + unsafeContext() + +
    +
    +
    +
    +
    +
    +

    The internal NSManagedObjectContext managed by this QueryableSource. Using this context directly should typically be avoided, and is provided by CoreStore only for extremely specialized cases.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func unsafeContext() -> NSManagedObjectContext
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/SchemaMappingProvider.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/SchemaMappingProvider.html new file mode 100644 index 0000000..a83d3b5 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/SchemaMappingProvider.html @@ -0,0 +1,815 @@ + + + + SchemaMappingProvider Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SchemaMappingProvider

+
+
+
public protocol SchemaMappingProvider
+ +
+
+

The SchemaMappingProvider provides migration mapping information between two DynamicSchema versions.

+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/SectionMonitorBuilderType.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/SectionMonitorBuilderType.html new file mode 100644 index 0000000..d1a15f2 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/SectionMonitorBuilderType.html @@ -0,0 +1,897 @@ + + + + SectionMonitorBuilderType Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SectionMonitorBuilderType

+
+
+
@available(OSX 10.12, *)
+public protocol SectionMonitorBuilderType
+ +
+
+

Utility protocol for SectionMonitorChainBuilder. Used in methods that support chained fetch builders.

+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/SelectClause.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/SelectClause.html new file mode 100644 index 0000000..2d2825b --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/SelectClause.html @@ -0,0 +1,869 @@ + + + + SelectClause Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SelectClause

+
+
+
public protocol SelectClause
+ +
+
+

Abstracts the Select clause for protocol utilities.

+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/StorageInterface.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/StorageInterface.html new file mode 100644 index 0000000..3c95387 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/StorageInterface.html @@ -0,0 +1,934 @@ + + + + StorageInterface Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

StorageInterface

+
+
+
public protocol StorageInterface : AnyObject
+ +
+
+

The StorageInterface represents the data store managed (or to be managed) by the DataStack. When added to the DataStack, the StorageInterface serves as the interface for the NSPersistentStore. This may be a database file, an in-memory store, etc.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + storeType + +
    +
    +
    +
    +
    +
    +

    The string identifier for the NSPersistentStore‘s type property. This is the same string CoreStore will use to create the NSPersistentStore from the NSPersistentStoreCoordinator’s addPersistentStoreWithType(...) method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var storeType: String { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    +

    The configuration name in the model file

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var configuration: ModelConfiguration { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + storeOptions + +
    +
    +
    +
    +
    +
    +

    The options dictionary for the NSPersistentStore

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var storeOptions: [AnyHashable : Any]? { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/WhereClauseType.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/WhereClauseType.html new file mode 100644 index 0000000..1004c7b --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Protocols/WhereClauseType.html @@ -0,0 +1,966 @@ + + + + WhereClauseType Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

WhereClauseType

+
+
+
public protocol WhereClauseType : AnyWhereClause
+ +
+
+

Abstracts the Where clause for protocol utilities.

+ +
+
+ +
+
+
+ +
+
+ +
    +
  • +
    + + + + &&(_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Combines two Where predicates together using AND operator.

    +
    +

    Warning

    + This operator overload is a workaround for Swift generics’ inability to constrain by inheritance (https://bugs.swift.org/browse/SR-5213). In effect, this is less type-safe than other overloads because it allows AND'ing clauses of unrelated DynamicObject types. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func && <TWhere>(left: Self, right: TWhere) -> Self where TWhere : WhereClauseType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + &&(_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Combines two Where predicates together using AND operator.

    +
    +

    Warning

    + This operator overload is a workaround for Swift generics’ inability to constrain by inheritance (https://bugs.swift.org/browse/SR-5213). In effect, this is less type-safe than other overloads because it allows AND'ing clauses of unrelated DynamicObject types. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func && <TWhere>(left: TWhere, right: Self) -> Self where TWhere : WhereClauseType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ||(_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Combines two Where predicates together using OR operator.

    +
    +

    Warning

    + This operator overload is a workaround for Swift generics’ inability to constrain by inheritance (https://bugs.swift.org/browse/SR-5213). In effect, this is less type-safe than other overloads because it allows OR'ing clauses of unrelated DynamicObject types. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func || <TWhere>(left: Self, right: TWhere) -> Self where TWhere : WhereClauseType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ||(_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Combines two Where predicates together using OR operator.

    +
    +

    Warning

    + This operator overload is a workaround for Swift generics’ inability to constrain by inheritance (https://bugs.swift.org/browse/SR-5213). In effect, this is less type-safe than other overloads because it allows OR'ing clauses of unrelated DynamicObject types. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func || <TWhere>(left: TWhere, right: Self) -> Self where TWhere : WhereClauseType
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs.html new file mode 100644 index 0000000..caf7630 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs.html @@ -0,0 +1,1556 @@ + + + + Structures Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Structures

+

The following structures are available globally.

+ +
+
+ +
+
+
+
+ + + +

Tweak

+
+
+
    +
  • +
    + + + + Tweak + +
    +
    +
    +
    +
    +
    +

    The Tweak clause allows fine-tuning the NSFetchRequest for a fetch or query. +Sample usage:

    +
    let employees = transaction.fetchAll(
    +    From<MyPersonEntity>(),
    +    Tweak { (fetchRequest) -> Void in
    +        fetchRequest.includesPendingChanges = false
    +        fetchRequest.fetchLimit = 5
    +    }
    +)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct Tweak : FetchClause, QueryClause, DeleteClause
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + CloudStorageOptions + +
    +
    +
    +
    +
    +
    +

    The CloudStorageOptions provides settings that tells the DataStack how to setup the persistent store for LocalStorage implementers.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct CloudStorageOptions : OptionSet, ExpressibleByNilLiteral
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

From

+
+
+
    +
  • +
    + + + + From + +
    +
    +
    +
    +
    +
    +

    A From clause specifies the source entity and source persistent store for fetch and query methods. A common usage is to just indicate the entity:

    +
    let person = transaction.fetchOne(From<Person>())
    +
    + +

    For cases where multiple NSPersistentStores contain the same entity, the source configuration’s name needs to be specified as well:

    +
    let person = transaction.fetchOne(From<Person>("Configuration1"))
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct From<D> where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + GroupBy + +
    +
    +
    +
    +
    +
    +

    The GroupBy clause specifies that the result of a query be grouped accoording to the specified key path.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct GroupBy<D> : GroupByClause, QueryClause, Hashable where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Into

+
+
+
    +
  • +
    + + + + Into + +
    +
    +
    +
    +
    +
    +

    An Into clause contains the destination entity and destination persistent store for a create(...) method. A common usage is to just indicate the entity:

    +
    let person = transaction.create(Into<MyPersonEntity>())
    +
    + +

    For cases where multiple NSPersistentStores contain the same entity, the destination configuration’s name needs to be specified as well:

    +
    let person = transaction.create(Into<MyPersonEntity>("Configuration1"))
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct Into<D> : Hashable where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + LocalStorageOptions + +
    +
    +
    +
    +
    +
    +

    The LocalStorageOptions provides settings that tells the DataStack how to setup the persistent store for LocalStorage implementers.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct LocalStorageOptions : OptionSet, ExpressibleByNilLiteral
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + MigrationChain + +
    +
    +
    +
    +
    +
    +

    A MigrationChain indicates the sequence of model versions to be used as the order for progressive migrations. This is typically passed to the SchemaHistory or the DataStack initializer and will be applied to all stores added to the DataStack with addStorage(...) and its variants.

    + +

    Initializing with empty values (either nil, [], or [:]) instructs the DataStack to use the .xcdatamodel’s current version as the final version, and to disable progressive migrations:

    +
    let dataStack = DataStack(migrationChain: nil)
    +
    + +

    This means that the mapping model will be computed from the store’s version straight to the DataStack‘s model version. +To support progressive migrations, specify the linear order of versions:

    +
    let dataStack = DataStack(migrationChain:
    +   ["MyAppModel", "MyAppModelV2", "MyAppModelV3", "MyAppModelV4"])
    +
    + +

    or for more complex migration paths, a version tree that maps the key-values to the source-destination versions:

    +
    let dataStack = DataStack(migrationChain: [
    +    "MyAppModel": "MyAppModelV3",
    +    "MyAppModelV2": "MyAppModelV4",
    +    "MyAppModelV3": "MyAppModelV4"
    +])
    +
    + +

    This allows for different migration paths depending on the starting version. The example above resolves to the following paths:

    + +
      +
    • MyAppModel-MyAppModelV3-MyAppModelV4
    • +
    • MyAppModelV2-MyAppModelV4
    • +
    • MyAppModelV3-MyAppModelV4
    • +
    + +

    The MigrationChain is validated when passed to the DataStack and unless it is empty, will raise an assertion if any of the following conditions are met:

    + +
      +
    • a version appears twice in an array
    • +
    • a version appears twice as a key in a dictionary literal
    • +
    • a loop is found in any of the paths
    • +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct MigrationChain : ExpressibleByNilLiteral, ExpressibleByStringLiteral, ExpressibleByDictionaryLiteral, ExpressibleByArrayLiteral, Equatable
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • +
    + + + + SectionBy + +
    +
    +
    +
    +
    +
    +

    The SectionBy clause indicates the key path to use to group the ListMonitor objects into sections. An optional closure can also be provided to transform the value into an appropriate section name:

    +
    let monitor = CoreStore.monitorSectionedList(
    +    From<Person>(),
    +    SectionBy("age") { "Age \($0)" },
    +    OrderBy(.ascending("lastName"))
    +)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public struct SectionBy<D> where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Select

+
+
+
    +
  • +
    + + + + Select + +
    +
    +
    +
    +
    +
    +

    The Select clause indicates the attribute / aggregate value to be queried. The generic type is a SelectResultType, and will be used as the return type for the query.

    + +

    You can bind the return type by specializing the initializer:

    +
    let maximumAge = CoreStore.queryValue(
    +    From<MyPersonEntity>(),
    +    Select<Int>(.maximum("age"))
    +)
    +
    + +

    or by casting the type of the return value:

    +
    let maximumAge: Int = CoreStore.queryValue(
    +    From<MyPersonEntity>(),
    +    Select(.maximum("age"))
    +)
    +
    + +

    Valid return types depend on the query:

    + +
      +
    • for queryValue(...) methods: + +
    • +
    • for queryAttributes(...) methods:

      + +
        +
      • NSDictionary
      • +
    • +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct Select<D, T> : SelectClause, Hashable where D : DynamicObject, T : SelectResultType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sortDescriptors + + +
    +

    a series of NSSortDescriptors

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Where

+
+
+ +
+
+ +
    +
  • +
    + + + + VersionLock + +
    +
    +
    +
    +
    +
    +

    The VersionLock contains the version hashes for entities. This is then passed to the CoreStoreSchema, which contains all entities for the store. An assertion will be raised if any Entity doesn’t match the version hash.

    +
    class Animal: CoreStoreObject {
    +    let species = Value.Required<String>("species", initial: "")
    +    let nickname = Value.Optional<String>("nickname")
    +    let master = Relationship.ToOne<Person>("master")
    +}
    +class Person: CoreStoreObject {
    +    let name = Value.Required<String>("name", initial: "")
    +    let pet = Relationship.ToOne<Animal>("pet", inverse: { $0.master })
    +}
    +
    +CoreStore.defaultStack = DataStack(
    +    CoreStoreSchema(
    +        modelVersion: "V1",
    +        entities: [
    +            Entity<Animal>("Animal"),
    +            Entity<Person>("Person")
    +        ],
    +        versionLock: [
    +            "Animal": [0x2698c812ebbc3b97, 0x751e3fa3f04cf9, 0x51fd460d3babc82, 0x92b4ba735b5a3053],
    +            "Person": [0xae4060a59f990ef0, 0x8ac83a6e1411c130, 0xa29fea58e2e38ab6, 0x2071bb7e33d77887]
    +        ]
    +    )
    +)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct VersionLock : ExpressibleByDictionaryLiteral, Equatable
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + FetchChainBuilder + +
    +
    +
    +
    +
    +
    +

    The fetch builder type used for fetches. A FetchChainBuilder is created from a From clause.

    +
    let people = source.fetchAll(
    +    From<MyPersonEntity>()
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct FetchChainBuilder<D> : FetchChainableBuilderType where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + QueryChainBuilder + +
    +
    +
    +
    +
    +
    +

    The fetch builder type used for a queries. A QueryChainBuilder is created from a From clause and then a select(...) chain.

    +
    let averageAdultAge = dataStack.queryValue(
    +    From<MyPersonEntity>()
    +        .select(Int.self, .average(\.age))
    +        .where(\.age > 18)
    +)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct QueryChainBuilder<D, R> : QueryChainableBuilderType where D : DynamicObject, R : SelectResultType
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    The fetch builder type used for a sectioned ListMonitor. A SectionMonitorChainBuilder is created from a From clause and then a sectionBy(...) chain.

    +
    let monitor = transaction.monitorSectionedList(
    +    From<MyPersonEntity>()
    +        .sectionBy(\.age, { "\($0!) years old" })
    +        .where(\.age > 18)
    +        .orderBy(.ascending(\.age))
    +)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public struct SectionMonitorChainBuilder<D> : SectionMonitorBuilderType where D : DynamicObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + PartialObject + +
    +
    +
    +
    +
    +
    +

    A PartialObject is only used when overriding getters and setters for CoreStoreObject properties. Custom getters and setters are implemented as a closure that overrides the default property getter/setter. The closure receives a PartialObject<O>, which acts as a fast, type-safe KVC interface for CoreStoreObject. The reason a CoreStoreObject instance is not passed directly is because the Core Data runtime is not aware of CoreStoreObject properties’ static typing, and so loading those info everytime KVO invokes this accessor method incurs a heavy performance hit (especially in KVO-heavy operations such as ListMonitor observing.) When accessing the property value from PartialObject<O>, make sure to use PartialObject<O>.persistentValue(for:) instead of PartialObject<O>.value(for:), which would unintentionally execute the same closure again recursively.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct PartialObject<O> where O : CoreStoreObject
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/CloudStorageOptions.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/CloudStorageOptions.html new file mode 100644 index 0000000..9b18f87 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/CloudStorageOptions.html @@ -0,0 +1,1017 @@ + + + + CloudStorageOptions Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CloudStorageOptions

+
+
+
public struct CloudStorageOptions : OptionSet, ExpressibleByNilLiteral
+ +
+
+

The CloudStorageOptions provides settings that tells the DataStack how to setup the persistent store for LocalStorage implementers.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + none + +
    +
    +
    +
    +
    +
    +

    Tells the DataStack that the store should not be migrated or recreated, and should simply fail on model mismatch

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let none: CloudStorageOptions
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Tells the DataStack to delete and recreate the local store from the cloud store on model mismatch, otherwise exceptions will be thrown on failure instead

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let recreateLocalStoreOnModelMismatch: CloudStorageOptions
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Tells the DataStack to allow lightweight migration for the store when added synchronously

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let allowSynchronousLightweightMigration: CloudStorageOptions
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + init(rawValue:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(rawValue: Int)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + rawValue + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let rawValue: Int
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + init(nilLiteral:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(nilLiteral: ())
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/FetchChainBuilder.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/FetchChainBuilder.html new file mode 100644 index 0000000..0603645 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/FetchChainBuilder.html @@ -0,0 +1,1276 @@ + + + + FetchChainBuilder Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

FetchChainBuilder

+
+
+
public struct FetchChainBuilder<D> : FetchChainableBuilderType where D : DynamicObject
+ +
+
+

The fetch builder type used for fetches. A FetchChainBuilder is created from a From clause.

+
let people = source.fetchAll(
+    From<MyPersonEntity>()
+        .where(\.age > 18)
+        .orderBy(.ascending(\.age))
+)
+
+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = D
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + from + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var from: From<D>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchClauses + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var fetchClauses: [FetchClause]
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

From

+
+
+
    +
  • +
    + + + + where(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a Where clause to the FetchChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func `where`(_ clause: Where<D>) -> FetchChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clause + + +
    +

    a Where clause to add to the fetch builder

    +
    +
    +
    +
    +

    Return Value

    +

    a new FetchChainBuilder containing the Where clause

    +
    +
    +
    +
  • +
  • +
    + + + + where(format:_:) + +
    +
    +
    +
    +
    +
    +

    Adds a Where clause to the FetchChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func `where`(format: String, _ args: Any...) -> FetchChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + format + + +
    +

    the format string for the predicate

    +
    +
    + + args + + +
    +

    the arguments for format

    +
    +
    +
    +
    +

    Return Value

    +

    a new FetchChainBuilder containing the Where clause

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Adds a Where clause to the FetchChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func `where`(format: String, argumentArray: [Any]?) -> FetchChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + format + + +
    +

    the format string for the predicate

    +
    +
    + + argumentArray + + +
    +

    the arguments for format

    +
    +
    +
    +
    +

    Return Value

    +

    a new FetchChainBuilder containing the Where clause

    +
    +
    +
    +
  • +
  • +
    + + + + orderBy(_:_:) + +
    +
    +
    +
    +
    +
    +

    Adds an OrderBy clause to the FetchChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func orderBy(_ sortKey: OrderBy<D>.SortKey, _ sortKeys: OrderBy<D>.SortKey...) -> FetchChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sortKey + + +
    +

    a single SortKey

    +
    +
    + + sortKeys + + +
    +

    a series of other SortKeys

    +
    +
    +
    +
    +

    Return Value

    +

    a new FetchChainBuilder containing the OrderBy clause

    +
    +
    +
    +
  • +
  • +
    + + + + tweak(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a Tweak clause to the FetchChainBuilder with a closure where the NSFetchRequest may be configured

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func tweak(_ fetchRequest: @escaping (NSFetchRequest<NSFetchRequestResult>) -> Void) -> FetchChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + fetchRequest + + +
    +

    the block to customize the NSFetchRequest

    +
    +
    +
    +
    +

    Return Value

    +

    a new FetchChainBuilder containing the Tweak clause

    +
    +
    +
    +
  • +
  • +
    + + + + appending(_:) + +
    +
    +
    +
    +
    +
    +

    Appends a FetchClause to the FetchChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func appending(_ clause: FetchClause) -> FetchChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clause + + +
    +

    the FetchClause to add to the FetchChainBuilder

    +
    +
    +
    +
    +

    Return Value

    +

    a new FetchChainBuilder containing the FetchClause

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Appends a series of FetchClauses to the FetchChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func appending<S>(contentsOf clauses: S) -> FetchChainBuilder<D> where S : Sequence, S.Element == FetchClause
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauses + + +
    +

    the FetchClauses to add to the FetchChainBuilder

    +
    +
    +
    +
    +

    Return Value

    +

    a new FetchChainBuilder containing the FetchClauses

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/From.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/From.html new file mode 100644 index 0000000..17de2aa --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/From.html @@ -0,0 +1,2873 @@ + + + + From Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

From

+
+
+
public struct From<D> where D : DynamicObject
+ +
+
+

A From clause specifies the source entity and source persistent store for fetch and query methods. A common usage is to just indicate the entity:

+
let person = transaction.fetchOne(From<Person>())
+
+ +

For cases where multiple NSPersistentStores contain the same entity, the source configuration’s name needs to be specified as well:

+
let person = transaction.fetchOne(From<Person>("Configuration1"))
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + entityClass + +
    +
    +
    +
    +
    +
    +

    The associated NSManagedObject or CoreStoreObject entity class

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let entityClass: D.Type
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + configurations + +
    +
    +
    +
    +
    +
    +

    The NSPersistentStore configuration names to associate objects from. +May contain Strings to pertain to named configurations, or nil to pertain to the default configuration

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let configurations: [ModelConfiguration]?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes a From clause.

    +
    let people = transaction.fetchAll(From<MyPersonEntity>())
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a From clause with the specified entity type.

    +
    let people = transaction.fetchAll(From<MyPersonEntity>())
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ entity: D.Type)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the associated NSManagedObject or CoreStoreObject type

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a From clause with the specified configurations.

    +
    let people = transaction.fetchAll(From<MyPersonEntity>(nil, "Configuration1"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ configuration: ModelConfiguration, _ otherConfigurations: ModelConfiguration...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + configuration + + +
    +

    the NSPersistentStore configuration name to associate objects from. This parameter is required if multiple configurations contain the created NSManagedObject or CoreStoreObject‘s entity type. Set to nil to use the default configuration.

    +
    +
    + + otherConfigurations + + +
    +

    an optional list of other configuration names to associate objects from (see configuration parameter)

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a From clause with the specified configurations.

    +
    let people = transaction.fetchAll(From<MyPersonEntity>(["Configuration1", "Configuration2"]))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ configurations: [ModelConfiguration])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + configurations + + +
    +

    a list of NSPersistentStore configuration names to associate objects from. This parameter is required if multiple configurations contain the created NSManagedObject or CoreStoreObject‘s entity type. Set to nil to use the default configuration.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a From clause with the specified configurations.

    +
    let people = transaction.fetchAll(From(MyPersonEntity.self, nil, "Configuration1"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ entity: D.Type, _ configuration: ModelConfiguration, _ otherConfigurations: ModelConfiguration...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entity + + +
    +

    the associated NSManagedObject or CoreStoreObject type

    +
    +
    + + configuration + + +
    +

    the NSPersistentStore configuration name to associate objects from. This parameter is required if multiple configurations contain the created NSManagedObject or CoreStoreObject‘s entity type. Set to nil to use the default configuration.

    +
    +
    + + otherConfigurations + + +
    +

    an optional list of other configuration names to associate objects from (see configuration parameter)

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a From clause with the specified configurations.

    +
    let people = transaction.fetchAll(From(MyPersonEntity.self, ["Configuration1", "Configuration1"]))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ entity: D.Type, _ configurations: [ModelConfiguration])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + entity + + +
    +

    the associated NSManagedObject or CoreStoreObject type

    +
    +
    + + configurations + + +
    +

    a list of NSPersistentStore configuration names to associate objects from. This parameter is required if multiple configurations contain the created NSManagedObject or CoreStoreObject‘s entity type. Set to nil to use the default configuration.

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

From

+
+
+ +
+
+
+ + + +

From

+
+
+
    +
  • +
    + + + + select(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a QueryChainBuilder that starts with a Select clause created from the specified key path

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func select<R>(_ keyPath: KeyPath<D, R>) -> QueryChainBuilder<D, R> where R : SelectResultType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to query the value for

    +
    +
    +
    +
    +

    Return Value

    +

    a QueryChainBuilder that starts with a Select clause created from the specified key path

    +
    +
    +
    +
  • +
  • +
    + + + + sectionBy(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a SectionMonitorChainBuilder with the key path to use to group ListMonitor objects into sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public func sectionBy<T>(_ sectionKeyPath: KeyPath<D, T>) -> SectionMonitorChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sectionKeyPath + + +
    +

    the KeyPath to use to group the objects into sections

    +
    +
    +
    +
    +

    Return Value

    +

    a SectionMonitorChainBuilder that is sectioned by the specified key path

    +
    +
    +
    +
  • +
  • +
    + + + + sectionBy(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a SectionMonitorChainBuilder with the key path to use to group ListMonitor objects into sections, and a closure to transform the value for the key path to an appropriate section name

    +
    +

    Important

    + Some utilities (such as ListMonitors) may keep SectionBys in memory and may thus introduce retain cycles if reference captures are not handled properly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public func sectionBy<T>(_ sectionKeyPath: KeyPath<D, T>, _ sectionIndexTransformer: @escaping (_ sectionName: String?) -> String?) -> SectionMonitorChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionKeyPath + + +
    +

    the KeyPath to use to group the objects into sections

    +
    +
    + + sectionIndexTransformer + + +
    +

    a closure to transform the value for the key path to an appropriate section name

    +
    +
    +
    +
    +

    Return Value

    +

    a SectionMonitorChainBuilder that is sectioned by the specified key path

    +
    +
    +
    +
  • +
+
+
+
+ + + +

From

+
+
+
    +
  • +
    + + + + where(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a FetchChainBuilder that starts with the specified Where clause

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func `where`<T>(_ clause: (D) -> T) -> FetchChainBuilder<D> where T : AnyWhereClause
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clause + + +
    +

    a closure that returns a Where clause

    +
    +
    +
    +
    +

    Return Value

    +

    a FetchChainBuilder that starts with the specified Where clause

    +
    +
    +
    +
  • +
  • +
    + + + + select(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a QueryChainBuilder that starts with a Select clause created from the specified key path

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func select<R>(_ keyPath: KeyPath<D, ValueContainer<D>.Required<R>>) -> QueryChainBuilder<D, R> where R : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to query the value for

    +
    +
    +
    +
    +

    Return Value

    +

    a QueryChainBuilder that starts with a Select clause created from the specified key path

    +
    +
    +
    +
  • +
  • +
    + + + + select(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a QueryChainBuilder that starts with a Select clause created from the specified key path

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func select<R>(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<R>>) -> QueryChainBuilder<D, R> where R : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to query the value for

    +
    +
    +
    +
    +

    Return Value

    +

    a QueryChainBuilder that starts with a Select clause created from the specified key path

    +
    +
    +
    +
  • +
  • +
    + + + + select(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a QueryChainBuilder that starts with a Select clause created from the specified key path

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func select<R>(_ keyPath: KeyPath<D, TransformableContainer<D>.Required<R>>) -> QueryChainBuilder<D, R> where R : SelectResultType, R : NSCoding, R : NSCopying
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to query the value for

    +
    +
    +
    +
    +

    Return Value

    +

    a QueryChainBuilder that starts with a Select clause created from the specified key path

    +
    +
    +
    +
  • +
  • +
    + + + + select(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a QueryChainBuilder that starts with a Select clause created from the specified key path

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func select<R>(_ keyPath: KeyPath<D, TransformableContainer<D>.Optional<R>>) -> QueryChainBuilder<D, R> where R : SelectResultType, R : NSCoding, R : NSCopying
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to query the value for

    +
    +
    +
    +
    +

    Return Value

    +

    a QueryChainBuilder that starts with a Select clause created from the specified key path

    +
    +
    +
    +
  • +
  • +
    + + + + sectionBy(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a SectionMonitorChainBuilder with the key path to use to group ListMonitor objects into sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public func sectionBy<T>(_ sectionKeyPath: KeyPath<D, ValueContainer<D>.Required<T>>) -> SectionMonitorChainBuilder<D> where T : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sectionKeyPath + + +
    +

    the KeyPath to use to group the objects into sections

    +
    +
    +
    +
    +

    Return Value

    +

    a SectionMonitorChainBuilder that is sectioned by the specified key path

    +
    +
    +
    +
  • +
  • +
    + + + + sectionBy(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a SectionMonitorChainBuilder with the key path to use to group ListMonitor objects into sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public func sectionBy<T>(_ sectionKeyPath: KeyPath<D, ValueContainer<D>.Optional<T>>) -> SectionMonitorChainBuilder<D> where T : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sectionKeyPath + + +
    +

    the KeyPath to use to group the objects into sections

    +
    +
    +
    +
    +

    Return Value

    +

    a SectionMonitorChainBuilder that is sectioned by the specified key path

    +
    +
    +
    +
  • +
  • +
    + + + + sectionBy(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a SectionMonitorChainBuilder with the key path to use to group ListMonitor objects into sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public func sectionBy<T>(_ sectionKeyPath: KeyPath<D, TransformableContainer<D>.Required<T>>) -> SectionMonitorChainBuilder<D> where T : NSCoding, T : NSCopying
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sectionKeyPath + + +
    +

    the KeyPath to use to group the objects into sections

    +
    +
    +
    +
    +

    Return Value

    +

    a SectionMonitorChainBuilder that is sectioned by the specified key path

    +
    +
    +
    +
  • +
  • +
    + + + + sectionBy(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a SectionMonitorChainBuilder with the key path to use to group ListMonitor objects into sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public func sectionBy<T>(_ sectionKeyPath: KeyPath<D, TransformableContainer<D>.Optional<T>>) -> SectionMonitorChainBuilder<D> where T : NSCoding, T : NSCopying
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sectionKeyPath + + +
    +

    the KeyPath to use to group the objects into sections

    +
    +
    +
    +
    +

    Return Value

    +

    a SectionMonitorChainBuilder that is sectioned by the specified key path

    +
    +
    +
    +
  • +
  • +
    + + + + sectionBy(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a SectionMonitorChainBuilder with the key path to use to group ListMonitor objects into sections, and a closure to transform the value for the key path to an appropriate section name

    +
    +

    Important

    + Some utilities (such as ListMonitors) may keep SectionBys in memory and may thus introduce retain cycles if reference captures are not handled properly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public func sectionBy<T>(_ sectionKeyPath: KeyPath<D, ValueContainer<D>.Required<T>>, _ sectionIndexTransformer: @escaping (_ sectionName: String?) -> String?) -> SectionMonitorChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionKeyPath + + +
    +

    the KeyPath to use to group the objects into sections

    +
    +
    + + sectionIndexTransformer + + +
    +

    a closure to transform the value for the key path to an appropriate section name

    +
    +
    +
    +
    +

    Return Value

    +

    a SectionMonitorChainBuilder that is sectioned by the specified key path

    +
    +
    +
    +
  • +
  • +
    + + + + sectionBy(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a SectionMonitorChainBuilder with the key path to use to group ListMonitor objects into sections, and a closure to transform the value for the key path to an appropriate section name

    +
    +

    Important

    + Some utilities (such as ListMonitors) may keep SectionBys in memory and may thus introduce retain cycles if reference captures are not handled properly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public func sectionBy<T>(_ sectionKeyPath: KeyPath<D, ValueContainer<D>.Optional<T>>, _ sectionIndexTransformer: @escaping (_ sectionName: String?) -> String?) -> SectionMonitorChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionKeyPath + + +
    +

    the KeyPath to use to group the objects into sections

    +
    +
    + + sectionIndexTransformer + + +
    +

    a closure to transform the value for the key path to an appropriate section name

    +
    +
    +
    +
    +

    Return Value

    +

    a SectionMonitorChainBuilder that is sectioned by the specified key path

    +
    +
    +
    +
  • +
  • +
    + + + + sectionBy(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a SectionMonitorChainBuilder with the key path to use to group ListMonitor objects into sections, and a closure to transform the value for the key path to an appropriate section name

    +
    +

    Important

    + Some utilities (such as ListMonitors) may keep SectionBys in memory and may thus introduce retain cycles if reference captures are not handled properly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public func sectionBy<T>(_ sectionKeyPath: KeyPath<D, TransformableContainer<D>.Required<T>>, _ sectionIndexTransformer: @escaping (_ sectionName: String?) -> String?) -> SectionMonitorChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionKeyPath + + +
    +

    the KeyPath to use to group the objects into sections

    +
    +
    + + sectionIndexTransformer + + +
    +

    a closure to transform the value for the key path to an appropriate section name

    +
    +
    +
    +
    +

    Return Value

    +

    a SectionMonitorChainBuilder that is sectioned by the specified key path

    +
    +
    +
    +
  • +
  • +
    + + + + sectionBy(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a SectionMonitorChainBuilder with the key path to use to group ListMonitor objects into sections, and a closure to transform the value for the key path to an appropriate section name

    +
    +

    Important

    + Some utilities (such as ListMonitors) may keep SectionBys in memory and may thus introduce retain cycles if reference captures are not handled properly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.12, *)
    +public func sectionBy<T>(_ sectionKeyPath: KeyPath<D, TransformableContainer<D>.Optional<T>>, _ sectionIndexTransformer: @escaping (_ sectionName: String?) -> String?) -> SectionMonitorChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionKeyPath + + +
    +

    the KeyPath to use to group the objects into sections

    +
    +
    + + sectionIndexTransformer + + +
    +

    a closure to transform the value for the key path to an appropriate section name

    +
    +
    +
    +
    +

    Return Value

    +

    a SectionMonitorChainBuilder that is sectioned by the specified key path

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/GroupBy.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/GroupBy.html new file mode 100644 index 0000000..e6847d5 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/GroupBy.html @@ -0,0 +1,1345 @@ + + + + GroupBy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

GroupBy

+
+
+
public struct GroupBy<D> : GroupByClause, QueryClause, Hashable where D : DynamicObject
+ +
+
+

The GroupBy clause specifies that the result of a query be grouped accoording to the specified key path.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes a GroupBy clause with an empty list of key path strings

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a GroupBy clause with a list of key path strings

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ keyPath: KeyPathString, _ keyPaths: KeyPathString...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    a key path string to group results with

    +
    +
    + + keyPaths + + +
    +

    a series of key path strings to group results with

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a GroupBy clause with a list of key path strings

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ keyPaths: [KeyPathString])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPaths + + +
    +

    a list of key path strings to group results with

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = D
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + keyPaths + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let keyPaths: [KeyPathString]
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: GroupBy, rhs: GroupBy) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a GroupBy clause with a key path

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ keyPath: KeyPath<D, T>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    a key path to group results with

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a GroupBy clause with a key path

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ keyPath: KeyPath<D, ValueContainer<D>.Required<T>>) where T : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    a key path to group results with

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a GroupBy clause with a key path

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<T>>) where T : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    a key path to group results with

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a GroupBy clause with a key path

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ keyPath: KeyPath<D, TransformableContainer<D>.Required<T>>) where T : NSCoding, T : NSCopying
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    a key path to group results with

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a GroupBy clause with a key path

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ keyPath: KeyPath<D, TransformableContainer<D>.Optional<T>>) where T : NSCoding, T : NSCopying
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    a key path to group results with

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/Into.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/Into.html new file mode 100644 index 0000000..f008511 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/Into.html @@ -0,0 +1,1145 @@ + + + + Into Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Into

+
+
+
public struct Into<D> : Hashable where D : DynamicObject
+ +
+
+

An Into clause contains the destination entity and destination persistent store for a create(...) method. A common usage is to just indicate the entity:

+
let person = transaction.create(Into<MyPersonEntity>())
+
+ +

For cases where multiple NSPersistentStores contain the same entity, the destination configuration’s name needs to be specified as well:

+
let person = transaction.create(Into<MyPersonEntity>("Configuration1"))
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + entityClass + +
    +
    +
    +
    +
    +
    +

    The associated NSManagedObject or CoreStoreObject entity class

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let entityClass: D.Type
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    +

    The NSPersistentStore configuration name to associate objects from. +May contain a String to pertain to a named configuration, or nil to pertain to the default configuration

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let configuration: ModelConfiguration
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes an Into clause.

    +
    let person = transaction.create(Into<MyPersonEntity>())
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes an Into clause with the specified entity type. This is useful for querying a subclass while binding the generic type with a base class.

    +
    let person = transaction.create(Into<MyPersonEntity>(MyEmployeeEntity.self))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ entity: D.Type)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entity + + +
    +

    the NSManagedObject or CoreStoreObject type to be created

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes an Into clause with the specified configuration.

    +
    let person = transaction.create(Into<MyPersonEntity>("Configuration1"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ configuration: ModelConfiguration)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + configuration + + +
    +

    the NSPersistentStore configuration name to associate the object to. This parameter is required if multiple configurations contain the created NSManagedObject‘s or CoreStoreObject’s entity type. Set to nil to use the default configuration.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes an Into clause with the specified entity type and configuration. This is useful for querying a subclass while binding the generic type with a base class.

    +
    let person = transaction.create(Into<MyPersonEntity>(MyEmployeeEntity.self, "Configuration1"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ entity: D.Type, _ configuration: ModelConfiguration)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + entity + + +
    +

    the NSManagedObject or CoreStoreObject type to be created

    +
    +
    + + configuration + + +
    +

    the NSPersistentStore configuration name to associate the object to. This parameter is required if multiple configurations contain the created NSManagedObject‘s or CoreStoreObject’s entity type. Set to nil to use the default configuration.

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == <U, V>(lhs: Into<U>, rhs: Into<V>) -> Bool where U : DynamicObject, V : DynamicObject
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/LocalStorageOptions.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/LocalStorageOptions.html new file mode 100644 index 0000000..7969272 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/LocalStorageOptions.html @@ -0,0 +1,1044 @@ + + + + LocalStorageOptions Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

LocalStorageOptions

+
+
+
public struct LocalStorageOptions : OptionSet, ExpressibleByNilLiteral
+ +
+
+

The LocalStorageOptions provides settings that tells the DataStack how to setup the persistent store for LocalStorage implementers.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + none + +
    +
    +
    +
    +
    +
    +

    Tells the DataStack that the store should not be migrated or recreated, and should simply fail on model mismatch

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let none: LocalStorageOptions
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Tells the DataStack to delete and recreate the store on model mismatch, otherwise exceptions will be thrown on failure instead

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let recreateStoreOnModelMismatch: LocalStorageOptions
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Tells the DataStack to prevent progressive migrations for the store

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let preventProgressiveMigration: LocalStorageOptions
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Tells the DataStack to allow lightweight migration for the store when added synchronously

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let allowSynchronousLightweightMigration: LocalStorageOptions
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + init(rawValue:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(rawValue: Int)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + rawValue + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let rawValue: Int
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + init(nilLiteral:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(nilLiteral: ())
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/MigrationChain.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/MigrationChain.html new file mode 100644 index 0000000..e6d8e14 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/MigrationChain.html @@ -0,0 +1,1253 @@ + + + + MigrationChain Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

MigrationChain

+
+
+
public struct MigrationChain : ExpressibleByNilLiteral, ExpressibleByStringLiteral, ExpressibleByDictionaryLiteral, ExpressibleByArrayLiteral, Equatable
+ +
+
+

A MigrationChain indicates the sequence of model versions to be used as the order for progressive migrations. This is typically passed to the SchemaHistory or the DataStack initializer and will be applied to all stores added to the DataStack with addStorage(...) and its variants.

+ +

Initializing with empty values (either nil, [], or [:]) instructs the DataStack to use the .xcdatamodel’s current version as the final version, and to disable progressive migrations:

+
let dataStack = DataStack(migrationChain: nil)
+
+ +

This means that the mapping model will be computed from the store’s version straight to the DataStack‘s model version. +To support progressive migrations, specify the linear order of versions:

+
let dataStack = DataStack(migrationChain:
+   ["MyAppModel", "MyAppModelV2", "MyAppModelV3", "MyAppModelV4"])
+
+ +

or for more complex migration paths, a version tree that maps the key-values to the source-destination versions:

+
let dataStack = DataStack(migrationChain: [
+    "MyAppModel": "MyAppModelV3",
+    "MyAppModelV2": "MyAppModelV4",
+    "MyAppModelV3": "MyAppModelV4"
+])
+
+ +

This allows for different migration paths depending on the starting version. The example above resolves to the following paths:

+ +
    +
  • MyAppModel-MyAppModelV3-MyAppModelV4
  • +
  • MyAppModelV2-MyAppModelV4
  • +
  • MyAppModelV3-MyAppModelV4
  • +
+ +

The MigrationChain is validated when passed to the DataStack and unless it is empty, will raise an assertion if any of the following conditions are met:

+ +
    +
  • a version appears twice in an array
  • +
  • a version appears twice as a key in a dictionary literal
  • +
  • a loop is found in any of the paths
  • +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes the MigrationChain with empty values, which instructs the DataStack to use the .xcdatamodel’s current version as the final version, and to disable progressive migrations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes the MigrationChain with a single model version, which instructs the DataStack to use the the specified version as the final version, and to disable progressive migrations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ value: String)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes the MigrationChain with a linear order of versions, which becomes the order of the DataStack‘s progressive migrations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ elements: T) where T : Collection, T.Element == String
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes the MigrationChain with a version tree, which becomes the order of the DataStack‘s progressive migrations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ elements: [(String, String)])
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes the MigrationChain with a version tree, which becomes the order of the DataStack‘s progressive migrations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ dictionary: [String : String])
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + init(nilLiteral:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(nilLiteral: ())
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + init(stringLiteral:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(stringLiteral value: String)
    + +
    +
    +
    +
    +
  • +
+
+
+ + +
+
+ +
    +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(unicodeScalarLiteral value: String)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(dictionaryLiteral elements: (String, String)...)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + init(arrayLiteral:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(arrayLiteral elements: String...)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: MigrationChain, rhs: MigrationChain) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/OrderBy.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/OrderBy.html new file mode 100644 index 0000000..ac392a3 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/OrderBy.html @@ -0,0 +1,1278 @@ + + + + OrderBy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

OrderBy

+
+
+
public struct OrderBy<D> : OrderByClause, FetchClause, QueryClause, DeleteClause, Hashable where D : DynamicObject
+ +
+
+

The OrderBy clause specifies the sort order for results for a fetch or a query.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + +(_:_:) + +
    +
    +
    +
    +
    +
    +

    Combines two OrderBy sort descriptors together

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func + (left: OrderBy, right: OrderBy) -> OrderBy
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + +=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Combines two OrderBy sort descriptors together and stores the result to the left operand

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func += (left: inout OrderBy, right: OrderBy)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes a OrderBy clause with an empty list of sort descriptors

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a OrderBy clause with a single sort descriptor

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ sortDescriptor: NSSortDescriptor)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sortDescriptor + + +
    +

    a NSSortDescriptor

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a OrderBy clause with a list of sort descriptors

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ sortDescriptors: [NSSortDescriptor])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sortDescriptors + + +
    +

    a series of NSSortDescriptors

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a OrderBy clause with a series of SortKeys

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ sortKeys: [SortKey])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sortKey + + +
    +

    a series of SortKeys

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a OrderBy clause with a series of SortKeys

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ sortKey: SortKey, _ sortKeys: SortKey...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sortKey + + +
    +

    a single SortKey

    +
    +
    + + sortKeys + + +
    +

    a series of SortKeys

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = D
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + sortDescriptors + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let sortDescriptors: [NSSortDescriptor]
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: OrderBy, rhs: OrderBy) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + SortKey + +
    +
    +
    +
    +
    +
    +

    The SortKey is passed to the OrderBy clause to indicate the sort keys and their sort direction.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct SortKey
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/OrderBy/SortKey.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/OrderBy/SortKey.html new file mode 100644 index 0000000..6b206e9 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/OrderBy/SortKey.html @@ -0,0 +1,1206 @@ + + + + SortKey Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SortKey

+
+
+
public struct SortKey
+ +
+
+

The SortKey is passed to the OrderBy clause to indicate the sort keys and their sort direction.

+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + ascending(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the KeyPathString should be sorted in ascending order

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ascending(_ keyPath: KeyPathString) -> SortKey
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + descending(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the KeyPathString should be sorted in descending order

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func descending(_ keyPath: KeyPathString) -> SortKey
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ascending(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the KeyPathString should be sorted in ascending order

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ascending<T>(_ keyPath: KeyPath<D, T>) -> SortKey
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + descending(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the KeyPathString should be sorted in descending order

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func descending<T>(_ keyPath: KeyPath<D, T>) -> SortKey
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ascending(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the KeyPathString should be sorted in ascending order

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ascending<T>(_ attribute: KeyPath<D, ValueContainer<D>.Required<T>>) -> SortKey where T : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ascending(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the KeyPathString should be sorted in ascending order

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ascending<T>(_ attribute: KeyPath<D, ValueContainer<D>.Optional<T>>) -> SortKey where T : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ascending(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the KeyPathString should be sorted in ascending order

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ascending<T>(_ attribute: KeyPath<D, TransformableContainer<D>.Required<T>>) -> SortKey where T : NSCoding, T : NSCopying
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ascending(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the KeyPathString should be sorted in ascending order

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ascending<T>(_ attribute: KeyPath<D, TransformableContainer<D>.Optional<T>>) -> SortKey where T : NSCoding, T : NSCopying
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + descending(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the KeyPathString should be sorted in descending order

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func descending<T>(_ attribute: KeyPath<D, ValueContainer<D>.Required<T>>) -> SortKey where T : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + descending(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the KeyPathString should be sorted in descending order

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func descending<T>(_ attribute: KeyPath<D, ValueContainer<D>.Optional<T>>) -> SortKey where T : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + descending(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the KeyPathString should be sorted in descending order

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func descending<T>(_ attribute: KeyPath<D, TransformableContainer<D>.Required<T>>) -> SortKey where T : NSCoding, T : NSCopying
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + descending(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the KeyPathString should be sorted in descending order

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func descending<T>(_ attribute: KeyPath<D, TransformableContainer<D>.Optional<T>>) -> SortKey where T : NSCoding, T : NSCopying
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ascending(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the KeyPathString should be sorted in ascending order

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ascending<K>(_ attribute: (D) -> K) -> OrderBy<D>.SortKey where K : DynamicKeyPath
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + descending(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the KeyPathString should be sorted in descending order

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func descending<K>(_ attribute: (D) -> K) -> OrderBy<D>.SortKey where K : DynamicKeyPath
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/PartialObject.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/PartialObject.html new file mode 100644 index 0000000..b7c70be --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/PartialObject.html @@ -0,0 +1,1307 @@ + + + + PartialObject Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

PartialObject

+
+
+
public struct PartialObject<O> where O : CoreStoreObject
+ +
+
+

A PartialObject is only used when overriding getters and setters for CoreStoreObject properties. Custom getters and setters are implemented as a closure that overrides the default property getter/setter. The closure receives a PartialObject<O>, which acts as a fast, type-safe KVC interface for CoreStoreObject. The reason a CoreStoreObject instance is not passed directly is because the Core Data runtime is not aware of CoreStoreObject properties’ static typing, and so loading those info everytime KVO invokes this accessor method incurs a heavy performance hit (especially in KVO-heavy operations such as ListMonitor observing.) When accessing the property value from PartialObject<O>, make sure to use PartialObject<O>.persistentValue(for:) instead of PartialObject<O>.value(for:), which would unintentionally execute the same closure again recursively.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + completeObject() + +
    +
    +
    +
    +
    +
    +

    Returns a the actual CoreStoreObject instance for the receiver.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func completeObject() -> O
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + value(for:) + +
    +
    +
    +
    +
    +
    +

    Returns the value for the property identified by a given key.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func value<V>(for property: (O) -> ValueContainer<O>.Required<V>) -> V where V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + setValue(_:for:) + +
    +
    +
    +
    +
    +
    +

    Sets the property of the receiver specified by a given key to a given value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func setValue<V>(_ value: V, for property: (O) -> ValueContainer<O>.Required<V>) where V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + primitiveValue(for:) + +
    +
    +
    +
    +
    +
    +

    Returns the value for the specified property from the managed object’s private internal storage.

    + +

    This method does not invoke the access notification methods (willAccessValue(forKey:) and didAccessValue(forKey:)). This method is used primarily by subclasses that implement custom accessor methods that need direct access to the receiver’s private storage.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func primitiveValue<V>(for property: (O) -> ValueContainer<O>.Required<V>) -> V where V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Sets in the object’s private internal storage the value of a given property.

    + +

    Sets in the receiver’s private internal storage the value of the property specified by key to value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func setPrimitiveValue<V>(_ value: V, for property: (O) -> ValueContainer<O>.Required<V>) where V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + value(for:) + +
    +
    +
    +
    +
    +
    +

    Returns the value for the property identified by a given key.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func value<V>(for property: (O) -> ValueContainer<O>.Optional<V>) -> V? where V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + setValue(_:for:) + +
    +
    +
    +
    +
    +
    +

    Sets the property of the receiver specified by a given key to a given value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func setValue<V>(_ value: V?, for property: (O) -> ValueContainer<O>.Optional<V>) where V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + primitiveValue(for:) + +
    +
    +
    +
    +
    +
    +

    Returns the value for the specified property from the managed object’s private internal storage.

    + +

    This method does not invoke the access notification methods (willAccessValue(forKey:) and didAccessValue(forKey:)). This method is used primarily by subclasses that implement custom accessor methods that need direct access to the receiver’s private storage.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func primitiveValue<V>(for property: (O) -> ValueContainer<O>.Optional<V>) -> V? where V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Sets in the object’s private internal storage the value of a given property.

    + +

    Sets in the receiver’s private internal storage the value of the property specified by key to value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func setPrimitiveValue<V>(_ value: V?, for property: (O) -> ValueContainer<O>.Optional<V>) where V : ImportableAttributeType
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + value(for:) + +
    +
    +
    +
    +
    +
    +

    Returns the value for the property identified by a given key.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func value<V>(for property: (O) -> TransformableContainer<O>.Required<V>) -> V where V : NSCoding, V : NSCopying
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + setValue(_:for:) + +
    +
    +
    +
    +
    +
    +

    Sets the property of the receiver specified by a given key to a given value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func setValue<V>(_ value: V, for property: (O) -> TransformableContainer<O>.Required<V>) where V : NSCoding, V : NSCopying
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + primitiveValue(for:) + +
    +
    +
    +
    +
    +
    +

    Returns the value for the specified property from the managed object’s private internal storage.

    + +

    This method does not invoke the access notification methods (willAccessValue(forKey:) and didAccessValue(forKey:)). This method is used primarily by subclasses that implement custom accessor methods that need direct access to the receiver’s private storage.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func primitiveValue<V>(for property: (O) -> TransformableContainer<O>.Required<V>) -> V where V : NSCoding, V : NSCopying
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Sets in the object’s private internal storage the value of a given property.

    + +

    Sets in the receiver’s private internal storage the value of the property specified by key to value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func setPrimitiveValue<V>(_ value: V, for property: (O) -> TransformableContainer<O>.Required<V>) where V : NSCoding, V : NSCopying
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + value(for:) + +
    +
    +
    +
    +
    +
    +

    Returns the value for the property identified by a given key.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func value<V>(for property: (O) -> TransformableContainer<O>.Optional<V>) -> V? where V : NSCoding, V : NSCopying
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + setValue(_:for:) + +
    +
    +
    +
    +
    +
    +

    Sets the property of the receiver specified by a given key to a given value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func setValue<V>(_ value: V?, for property: (O) -> TransformableContainer<O>.Optional<V>) where V : NSCoding, V : NSCopying
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + primitiveValue(for:) + +
    +
    +
    +
    +
    +
    +

    Returns the value for the specified property from the managed object’s private internal storage.

    + +

    This method does not invoke the access notification methods (willAccessValue(forKey:) and didAccessValue(forKey:)). This method is used primarily by subclasses that implement custom accessor methods that need direct access to the receiver’s private storage.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func primitiveValue<V>(for property: (O) -> TransformableContainer<O>.Optional<V>) -> V? where V : NSCoding, V : NSCopying
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Sets in the object’s private internal storage the value of a given property.

    + +

    Sets in the receiver’s private internal storage the value of the property specified by key to value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func setPrimitiveValue<V>(_ value: V?, for property: (O) -> TransformableContainer<O>.Optional<V>) where V : NSCoding, V : NSCopying
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/QueryChainBuilder.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/QueryChainBuilder.html new file mode 100644 index 0000000..7c2bcd5 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/QueryChainBuilder.html @@ -0,0 +1,1812 @@ + + + + QueryChainBuilder Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

QueryChainBuilder

+
+
+
public struct QueryChainBuilder<D, R> : QueryChainableBuilderType where D : DynamicObject, R : SelectResultType
+ +
+
+

The fetch builder type used for a queries. A QueryChainBuilder is created from a From clause and then a select(...) chain.

+
let averageAdultAge = dataStack.queryValue(
+    From<MyPersonEntity>()
+        .select(Int.self, .average(\.age))
+        .where(\.age > 18)
+)
+
+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = D
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ResultType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ResultType = R
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + from + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var from: From<D>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + select + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var select: Select<D, R>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + queryClauses + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var queryClauses: [QueryClause]
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

From

+
+
+
    +
  • +
    + + + + where(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a Where clause to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func `where`(_ clause: Where<D>) -> QueryChainBuilder<D, R>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clause + + +
    +

    a Where clause to add to the query builder

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the Where clause

    +
    +
    +
    +
  • +
  • +
    + + + + where(format:_:) + +
    +
    +
    +
    +
    +
    +

    Adds a Where clause to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func `where`(format: String, _ args: Any...) -> QueryChainBuilder<D, R>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + format + + +
    +

    the format string for the predicate

    +
    +
    + + args + + +
    +

    the arguments for format

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the Where clause

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Adds a Where clause to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func `where`(format: String, argumentArray: [Any]?) -> QueryChainBuilder<D, R>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + format + + +
    +

    the format string for the predicate

    +
    +
    + + argumentArray + + +
    +

    the arguments for format

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the Where clause

    +
    +
    +
    +
  • +
  • +
    + + + + orderBy(_:_:) + +
    +
    +
    +
    +
    +
    +

    Adds an OrderBy clause to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func orderBy(_ sortKey: OrderBy<D>.SortKey, _ sortKeys: OrderBy<D>.SortKey...) -> QueryChainBuilder<D, R>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sortKey + + +
    +

    a single SortKey

    +
    +
    + + sortKeys + + +
    +

    a series of other SortKeys

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the OrderBy clause

    +
    +
    +
    +
  • +
  • +
    + + + + tweak(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a Tweak clause to the QueryChainBuilder with a closure where the NSFetchRequest may be configured

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func tweak(_ fetchRequest: @escaping (NSFetchRequest<NSFetchRequestResult>) -> Void) -> QueryChainBuilder<D, R>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + fetchRequest + + +
    +

    the block to customize the NSFetchRequest

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the Tweak clause

    +
    +
    +
    +
  • +
  • +
    + + + + groupBy(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a GroupBy clause to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func groupBy(_ clause: GroupBy<D>) -> QueryChainBuilder<D, R>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clause + + +
    +

    a GroupBy clause to add to the query builder

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the GroupBy clause

    +
    +
    +
    +
  • +
  • +
    + + + + groupBy(_:_:) + +
    +
    +
    +
    +
    +
    +

    Adds a GroupBy clause to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func groupBy(_ keyPath: KeyPathString, _ keyPaths: KeyPathString...) -> QueryChainBuilder<D, R>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    a key path to group the query results with

    +
    +
    + + keyPaths + + +
    +

    other key paths to group the query results with

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the GroupBy clause

    +
    +
    +
    +
  • +
  • +
    + + + + groupBy(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a GroupBy clause to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func groupBy(_ keyPaths: [KeyPathString]) -> QueryChainBuilder<D, R>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPaths + + +
    +

    a series of key paths to group the query results with

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the GroupBy clause

    +
    +
    +
    +
  • +
  • +
    + + + + appending(_:) + +
    +
    +
    +
    +
    +
    +

    Appends a QueryClause to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func appending(_ clause: QueryClause) -> QueryChainBuilder<D, R>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clause + + +
    +

    the QueryClause to add to the QueryChainBuilder

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the QueryClause

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Appends a series of QueryClauses to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func appending<S>(contentsOf clauses: S) -> QueryChainBuilder<D, R> where S : Sequence, S.Element == QueryClause
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauses + + +
    +

    the QueryClauses to add to the QueryChainBuilder

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the QueryClauses

    +
    +
    +
    +
  • +
+
+
+
+ + + +

From

+
+
+
    +
  • +
    + + + + groupBy(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a GroupBy clause to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func groupBy<T>(_ keyPath: KeyPath<D, T>) -> QueryChainBuilder<D, R>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    a key path to group the query results with

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the GroupBy clause

    +
    +
    +
    +
  • +
+
+
+
+ + + +

From

+
+
+
    +
  • +
    + + + + where(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a Where clause to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func `where`<T>(_ clause: (D) -> T) -> QueryChainBuilder<D, R> where T : AnyWhereClause
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clause + + +
    +

    a Where clause to add to the query builder

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the Where clause

    +
    +
    +
    +
  • +
  • +
    + + + + groupBy(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a GroupBy clause to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func groupBy<T>(_ keyPath: KeyPath<D, ValueContainer<D>.Required<T>>) -> QueryChainBuilder<D, R> where T : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    a key path to group the query results with

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the GroupBy clause

    +
    +
    +
    +
  • +
  • +
    + + + + groupBy(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a GroupBy clause to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func groupBy<T>(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<T>>) -> QueryChainBuilder<D, R> where T : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    a key path to group the query results with

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the GroupBy clause

    +
    +
    +
    +
  • +
  • +
    + + + + groupBy(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a GroupBy clause to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func groupBy<T>(_ keyPath: KeyPath<D, TransformableContainer<D>.Required<T>>) -> QueryChainBuilder<D, R> where T : NSCoding, T : NSCopying
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    a key path to group the query results with

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the GroupBy clause

    +
    +
    +
    +
  • +
  • +
    + + + + groupBy(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a GroupBy clause to the QueryChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func groupBy<T>(_ keyPath: KeyPath<D, TransformableContainer<D>.Optional<T>>) -> QueryChainBuilder<D, R> where T : NSCoding, T : NSCopying
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    a key path to group the query results with

    +
    +
    +
    +
    +

    Return Value

    +

    a new QueryChainBuilder containing the GroupBy clause

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/SectionBy.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/SectionBy.html new file mode 100644 index 0000000..d6fcae0 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/SectionBy.html @@ -0,0 +1,1508 @@ + + + + SectionBy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SectionBy

+
+
+
@available(OSX 10.12, *)
+public struct SectionBy<D> where D : DynamicObject
+ +
+
+

The SectionBy clause indicates the key path to use to group the ListMonitor objects into sections. An optional closure can also be provided to transform the value into an appropriate section name:

+
let monitor = CoreStore.monitorSectionedList(
+    From<Person>(),
+    SectionBy("age") { "Age \($0)" },
+    OrderBy(.ascending("lastName"))
+)
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a SectionBy clause with the key path to use to group ListMonitor objects into sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ sectionKeyPath: KeyPathString)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sectionKeyPath + + +
    +

    the key path to use to group the objects into sections

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a SectionBy clause with the key path to use to group ListMonitor objects into sections, and a closure to transform the value for the key path to an appropriate section name

    +
    +

    Important

    + Some utilities (such as ListMonitors) may keep SectionBys in memory and may thus introduce retain cycles if reference captures are not handled properly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ sectionKeyPath: KeyPathString, _ sectionIndexTransformer: @escaping (_ sectionName: String?) -> String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionKeyPath + + +
    +

    the key path to use to group the objects into sections

    +
    +
    + + sectionIndexTransformer + + +
    +

    a closure to transform the value for the key path to an appropriate section name

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a SectionBy clause with the key path to use to group ListMonitor objects into sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ sectionKeyPath: KeyPath<D, T>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sectionKeyPath + + +
    +

    the key path to use to group the objects into sections

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a SectionBy clause with the key path to use to group ListMonitor objects into sections, and a closure to transform the value for the key path to an appropriate section name

    +
    +

    Important

    + Some utilities (such as ListMonitors) may keep SectionBys in memory and may thus introduce retain cycles if reference captures are not handled properly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ sectionKeyPath: KeyPath<D, T>, _ sectionIndexTransformer: @escaping (_ sectionName: String?) -> String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionKeyPath + + +
    +

    the key path to use to group the objects into sections

    +
    +
    + + sectionIndexTransformer + + +
    +

    a closure to transform the value for the key path to an appropriate section name

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a SectionBy clause with the key path to use to group ListMonitor objects into sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ sectionKeyPath: KeyPath<D, ValueContainer<D>.Required<T>>) where T : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sectionKeyPath + + +
    +

    the key path to use to group the objects into sections

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a SectionBy clause with the key path to use to group ListMonitor objects into sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ sectionKeyPath: KeyPath<D, ValueContainer<D>.Optional<T>>) where T : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sectionKeyPath + + +
    +

    the key path to use to group the objects into sections

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a SectionBy clause with the key path to use to group ListMonitor objects into sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ sectionKeyPath: KeyPath<D, TransformableContainer<D>.Required<T>>) where T : NSCoding, T : NSCopying
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sectionKeyPath + + +
    +

    the key path to use to group the objects into sections

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a SectionBy clause with the key path to use to group ListMonitor objects into sections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ sectionKeyPath: KeyPath<D, TransformableContainer<D>.Optional<T>>) where T : NSCoding, T : NSCopying
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sectionKeyPath + + +
    +

    the key path to use to group the objects into sections

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a SectionBy clause with the key path to use to group ListMonitor objects into sections, and a closure to transform the value for the key path to an appropriate section name

    +
    +

    Important

    + Some utilities (such as ListMonitors) may keep SectionBys in memory and may thus introduce retain cycles if reference captures are not handled properly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ sectionKeyPath: KeyPath<D, ValueContainer<D>.Required<T>>, _ sectionIndexTransformer: @escaping (_ sectionName: String?) -> String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionKeyPath + + +
    +

    the key path to use to group the objects into sections

    +
    +
    + + sectionIndexTransformer + + +
    +

    a closure to transform the value for the key path to an appropriate section name

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a SectionBy clause with the key path to use to group ListMonitor objects into sections, and a closure to transform the value for the key path to an appropriate section name

    +
    +

    Important

    + Some utilities (such as ListMonitors) may keep SectionBys in memory and may thus introduce retain cycles if reference captures are not handled properly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ sectionKeyPath: KeyPath<D, ValueContainer<D>.Optional<T>>, _ sectionIndexTransformer: @escaping (_ sectionName: String?) -> String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionKeyPath + + +
    +

    the key path to use to group the objects into sections

    +
    +
    + + sectionIndexTransformer + + +
    +

    a closure to transform the value for the key path to an appropriate section name

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a SectionBy clause with the key path to use to group ListMonitor objects into sections, and a closure to transform the value for the key path to an appropriate section name

    +
    +

    Important

    + Some utilities (such as ListMonitors) may keep SectionBys in memory and may thus introduce retain cycles if reference captures are not handled properly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ sectionKeyPath: KeyPath<D, TransformableContainer<D>.Required<T>>, _ sectionIndexTransformer: @escaping (_ sectionName: String?) -> String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionKeyPath + + +
    +

    the key path to use to group the objects into sections

    +
    +
    + + sectionIndexTransformer + + +
    +

    a closure to transform the value for the key path to an appropriate section name

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a SectionBy clause with the key path to use to group ListMonitor objects into sections, and a closure to transform the value for the key path to an appropriate section name

    +
    +

    Important

    + Some utilities (such as ListMonitors) may keep SectionBys in memory and may thus introduce retain cycles if reference captures are not handled properly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<T>(_ sectionKeyPath: KeyPath<D, TransformableContainer<D>.Optional<T>>, _ sectionIndexTransformer: @escaping (_ sectionName: String?) -> String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionKeyPath + + +
    +

    the key path to use to group the objects into sections

    +
    +
    + + sectionIndexTransformer + + +
    +

    a closure to transform the value for the key path to an appropriate section name

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/SectionMonitorChainBuilder.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/SectionMonitorChainBuilder.html new file mode 100644 index 0000000..c0e2dce --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/SectionMonitorChainBuilder.html @@ -0,0 +1,1339 @@ + + + + SectionMonitorChainBuilder Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SectionMonitorChainBuilder

+
+
+
@available(OSX 10.12, *)
+public struct SectionMonitorChainBuilder<D> : SectionMonitorBuilderType where D : DynamicObject
+ +
+
+

The fetch builder type used for a sectioned ListMonitor. A SectionMonitorChainBuilder is created from a From clause and then a sectionBy(...) chain.

+
let monitor = transaction.monitorSectionedList(
+    From<MyPersonEntity>()
+        .sectionBy(\.age, { "\($0!) years old" })
+        .where(\.age > 18)
+        .orderBy(.ascending(\.age))
+)
+
+ +
+
+ +
+
+
+ +
    +
  • +
    + + + + from + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var from: From<D>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + sectionBy + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var sectionBy: SectionBy<D>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + fetchClauses + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var fetchClauses: [FetchClause]
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

From

+
+
+
    +
  • +
    + + + + where(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a Where clause to the SectionMonitorChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func `where`(_ clause: Where<D>) -> SectionMonitorChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clause + + +
    +

    a Where clause to add to the fetch builder

    +
    +
    +
    +
    +

    Return Value

    +

    a new SectionMonitorChainBuilder containing the Where clause

    +
    +
    +
    +
  • +
  • +
    + + + + where(format:_:) + +
    +
    +
    +
    +
    +
    +

    Adds a Where clause to the SectionMonitorChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func `where`(format: String, _ args: Any...) -> SectionMonitorChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + format + + +
    +

    the format string for the predicate

    +
    +
    + + args + + +
    +

    the arguments for format

    +
    +
    +
    +
    +

    Return Value

    +

    a new SectionMonitorChainBuilder containing the Where clause

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Adds a Where clause to the SectionMonitorChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func `where`(format: String, argumentArray: [Any]?) -> SectionMonitorChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + format + + +
    +

    the format string for the predicate

    +
    +
    + + argumentArray + + +
    +

    the arguments for format

    +
    +
    +
    +
    +

    Return Value

    +

    a new SectionMonitorChainBuilder containing the Where clause

    +
    +
    +
    +
  • +
  • +
    + + + + orderBy(_:_:) + +
    +
    +
    +
    +
    +
    +

    Adds an OrderBy clause to the SectionMonitorChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func orderBy(_ sortKey: OrderBy<D>.SortKey, _ sortKeys: OrderBy<D>.SortKey...) -> SectionMonitorChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sortKey + + +
    +

    a single SortKey

    +
    +
    + + sortKeys + + +
    +

    a series of other SortKeys

    +
    +
    +
    +
    +

    Return Value

    +

    a new SectionMonitorChainBuilder containing the OrderBy clause

    +
    +
    +
    +
  • +
  • +
    + + + + tweak(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a Tweak clause to the SectionMonitorChainBuilder with a closure where the NSFetchRequest may be configured

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func tweak(_ fetchRequest: @escaping (NSFetchRequest<NSFetchRequestResult>) -> Void) -> SectionMonitorChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + fetchRequest + + +
    +

    the block to customize the NSFetchRequest

    +
    +
    +
    +
    +

    Return Value

    +

    a new SectionMonitorChainBuilder containing the Tweak clause

    +
    +
    +
    +
  • +
  • +
    + + + + appending(_:) + +
    +
    +
    +
    +
    +
    +

    Appends a QueryClause to the SectionMonitorChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func appending(_ clause: FetchClause) -> SectionMonitorChainBuilder<D>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clause + + +
    +

    the QueryClause to add to the SectionMonitorChainBuilder

    +
    +
    +
    +
    +

    Return Value

    +

    a new SectionMonitorChainBuilder containing the QueryClause

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Appends a series of QueryClauses to the SectionMonitorChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func appending<S>(contentsOf clauses: S) -> SectionMonitorChainBuilder<D> where S : Sequence, S.Element == FetchClause
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clauses + + +
    +

    the QueryClauses to add to the SectionMonitorChainBuilder

    +
    +
    +
    +
    +

    Return Value

    +

    a new SectionMonitorChainBuilder containing the QueryClauses

    +
    +
    +
    +
  • +
+
+
+
+ + + +

From

+
+
+
    +
  • +
    + + + + where(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a Where clause to the SectionMonitorChainBuilder

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func `where`<T>(_ clause: (D) -> T) -> SectionMonitorChainBuilder<D> where T : AnyWhereClause
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + clause + + +
    +

    a Where clause to add to the fetch builder

    +
    +
    +
    +
    +

    Return Value

    +

    a new SectionMonitorChainBuilder containing the Where clause

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/Select.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/Select.html new file mode 100644 index 0000000..bb31440 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/Select.html @@ -0,0 +1,1422 @@ + + + + Select Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Select

+
+
+
public struct Select<D, T> : SelectClause, Hashable where D : DynamicObject, T : SelectResultType
+ +
+
+

The Select clause indicates the attribute / aggregate value to be queried. The generic type is a SelectResultType, and will be used as the return type for the query.

+ +

You can bind the return type by specializing the initializer:

+
let maximumAge = CoreStore.queryValue(
+    From<MyPersonEntity>(),
+    Select<Int>(.maximum("age"))
+)
+
+ +

or by casting the type of the return value:

+
let maximumAge: Int = CoreStore.queryValue(
+    From<MyPersonEntity>(),
+    Select(.maximum("age"))
+)
+
+ +

Valid return types depend on the query:

+ +
    +
  • for queryValue(...) methods: + +
  • +
  • for queryAttributes(...) methods:

    + +
      +
    • NSDictionary
    • +
  • +
+ +
+
+ +
+
+
+
    +
  • +
    + + + + init(_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Select clause with a list of SelectTerms

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ selectTerm: SelectTerm<D>, _ selectTerms: SelectTerm<D>...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + selectTerm + + +
    +

    a SelectTerm

    +
    +
    + + selectTerms + + +
    +

    a series of SelectTerms

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Select clause with a list of SelectTerms

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ selectTerms: [SelectTerm<D>])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + selectTerms + + +
    +

    a series of SelectTerms

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == <T, U>(lhs: Select<D, T>, rhs: Select<D, U>) -> Bool where T : SelectResultType, U : SelectResultType
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = D
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ReturnType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ReturnType = T
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + selectTerms + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let selectTerms: [SelectTerm<D>]
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Select

+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes a Select that queries for NSManagedObjectID results

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Select

+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Select that queries the value of an attribute pertained by a keyPath

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ keyPath: KeyPath<D, T>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the keyPath for the attribute

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Select

+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Select that queries the value of an attribute pertained by a keyPath

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ keyPath: KeyPath<D, ValueContainer<D>.Required<T>>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the keyPath for the attribute

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Select that queries the value of an attribute pertained by a keyPath

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<T>>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the keyPath for the attribute

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ + + +

Select

+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Select that queries the value of an attribute pertained by a keyPath

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ keyPath: KeyPath<D, TransformableContainer<D>.Required<T>>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the keyPath for the attribute

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Select that queries the value of an attribute pertained by a keyPath

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ keyPath: KeyPath<D, TransformableContainer<D>.Optional<T>>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + keyPath + + +
    +

    the keyPath for the attribute

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/Tweak.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/Tweak.html new file mode 100644 index 0000000..7bbbdff --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/Tweak.html @@ -0,0 +1,949 @@ + + + + Tweak Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Tweak

+
+
+
public struct Tweak : FetchClause, QueryClause, DeleteClause
+ +
+
+

The Tweak clause allows fine-tuning the NSFetchRequest for a fetch or query. +Sample usage:

+
let employees = transaction.fetchAll(
+    From<MyPersonEntity>(),
+    Tweak { (fetchRequest) -> Void in
+        fetchRequest.includesPendingChanges = false
+        fetchRequest.fetchLimit = 5
+    }
+)
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + closure + +
    +
    +
    +
    +
    +
    +

    The block to customize the NSFetchRequest

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let closure: (_ fetchRequest: NSFetchRequest<NSFetchRequestResult>) -> Void
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Tweak clause with a closure where the NSFetchRequest may be configured.

    +
    +

    Important

    + Tweak‘s closure is executed only just before the fetch occurs, so make sure that any values captured by the closure is not prone to race conditions. Also, some utilities (such as ListMonitors) may keep FetchClauses in memory and may thus introduce retain cycles if reference captures are not handled properly. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ closure: @escaping (_ fetchRequest: NSFetchRequest<NSFetchRequestResult>) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + closure + + +
    +

    the block to customize the NSFetchRequest

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + bridgeToObjectiveC + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var bridgeToObjectiveC: CSTweak { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/VersionLock.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/VersionLock.html new file mode 100644 index 0000000..be1d779 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/VersionLock.html @@ -0,0 +1,1093 @@ + + + + VersionLock Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

VersionLock

+
+
+
public struct VersionLock : ExpressibleByDictionaryLiteral, Equatable
+ +
+
+

The VersionLock contains the version hashes for entities. This is then passed to the CoreStoreSchema, which contains all entities for the store. An assertion will be raised if any Entity doesn’t match the version hash.

+
class Animal: CoreStoreObject {
+    let species = Value.Required<String>("species", initial: "")
+    let nickname = Value.Optional<String>("nickname")
+    let master = Relationship.ToOne<Person>("master")
+}
+class Person: CoreStoreObject {
+    let name = Value.Required<String>("name", initial: "")
+    let pet = Relationship.ToOne<Animal>("pet", inverse: { $0.master })
+}
+
+CoreStore.defaultStack = DataStack(
+    CoreStoreSchema(
+        modelVersion: "V1",
+        entities: [
+            Entity<Animal>("Animal"),
+            Entity<Person>("Person")
+        ],
+        versionLock: [
+            "Animal": [0x2698c812ebbc3b97, 0x751e3fa3f04cf9, 0x51fd460d3babc82, 0x92b4ba735b5a3053],
+            "Person": [0xae4060a59f990ef0, 0x8ac83a6e1411c130, 0xa29fea58e2e38ab6, 0x2071bb7e33d77887]
+        ]
+    )
+)
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + HashElement + +
    +
    +
    +
    +
    +
    +

    The value type for the dictionary initializer, which is UInt64

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias HashElement = UInt64
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + hashesByEntityName + +
    +
    +
    +
    +
    +
    +

    The Data hash for each entity name.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let hashesByEntityName: [EntityName : Data]
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a VersionLock with the version hash for each entity name.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ intArrayByEntityName: [EntityName : [HashElement]])
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + Key + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Key = EntityName
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + Value + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Value = [HashElement]
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(dictionaryLiteral elements: (EntityName, [HashElement])...)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: VersionLock, rhs: VersionLock) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/Where.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/Where.html new file mode 100644 index 0000000..948ced1 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Structs/Where.html @@ -0,0 +1,2911 @@ + + + + Where Structure Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Where

+
+
+
public struct Where<D> : WhereClauseType, FetchClause, QueryClause, DeleteClause, Hashable where D : DynamicObject
+ +
+
+

The Where clause specifies the conditions for a fetch or a query.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + &&(_:_:) + +
    +
    +
    +
    +
    +
    +

    Combines two Where predicates together using AND operator

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func && (left: Where<D>, right: Where<D>) -> Where<D>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ||(_:_:) + +
    +
    +
    +
    +
    +
    +

    Combines two Where predicates together using OR operator

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func || (left: Where<D>, right: Where<D>) -> Where<D>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + !(_:) + +
    +
    +
    +
    +
    +
    +

    Inverts the predicate of a Where clause using NOT operator

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public prefix static func ! (clause: Where<D>) -> Where<D>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + &&?(_:_:) + +
    +
    +
    +
    +
    +
    +

    Combines two Where predicates together using AND operator.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func &&? (left: Where<D>, right: Where<D>?) -> Where<D>
    + +
    +
    +
    +

    Return Value

    +

    left if right is nil, otherwise equivalent to (left && right)

    +
    +
    +
    +
  • +
  • +
    + + + + &&?(_:_:) + +
    +
    +
    +
    +
    +
    +

    Combines two Where predicates together using AND operator.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func &&? (left: Where<D>?, right: Where<D>) -> Where<D>
    + +
    +
    +
    +

    Return Value

    +

    right if left is nil, otherwise equivalent to (left && right)

    +
    +
    +
    +
  • +
  • +
    + + + + ||?(_:_:) + +
    +
    +
    +
    +
    +
    +

    Combines two Where predicates together using OR operator.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ||? (left: Where<D>, right: Where<D>?) -> Where<D>
    + +
    +
    +
    +

    Return Value

    +

    left if right is nil, otherwise equivalent to (left || right)

    +
    +
    +
    +
  • +
  • +
    + + + + ||?(_:_:) + +
    +
    +
    +
    +
    +
    +

    Combines two Where predicates together using OR operator.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ||? (left: Where<D>?, right: Where<D>) -> Where<D>
    + +
    +
    +
    +

    Return Value

    +

    right if left is nil, otherwise equivalent to (left || right)

    +
    +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause with a predicate that always evaluates to true

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause with a predicate that always evaluates to the specified boolean value

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ value: Bool)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + value + + +
    +

    the boolean value for the predicate

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause with a predicate using the specified string format and arguments

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ format: String, _ args: Any...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + format + + +
    +

    the format string for the predicate

    +
    +
    + + args + + +
    +

    the arguments for format

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a Where clause with a predicate using the specified string format and arguments

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ format: String, argumentArray: [Any]?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + format + + +
    +

    the format string for the predicate

    +
    +
    + + argumentArray + + +
    +

    the arguments for format

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality to nil

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ keyPath: KeyPathString, isEqualTo null: Void?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + null + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<U>(_ keyPath: KeyPathString, isEqualTo value: U?) where U : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + value + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<D>(_ keyPath: KeyPathString, isEqualTo object: D?) where D : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + object + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ keyPath: KeyPathString, isEqualTo objectID: NSManagedObjectID)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + objectID + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isMemberOf:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares membership

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<S>(_ keyPath: KeyPathString, isMemberOf list: S) where S : Sequence, S.Element : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + list + + +
    +

    the sequence to check membership of

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isMemberOf:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares membership

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<S>(_ keyPath: KeyPathString, isMemberOf list: S) where S : Sequence, S.Element : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + list + + +
    +

    the sequence to check membership of

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isMemberOf:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares membership

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<S>(_ keyPath: KeyPathString, isMemberOf list: S) where S : Sequence, S.Element : NSManagedObjectID
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + list + + +
    +

    the sequence to check membership of

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + predicate + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let predicate: NSPredicate
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ predicate: NSPredicate)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ObjectType + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ObjectType = D
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: Where, rhs: Where) -> Bool
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var debugDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality to nil

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<V>(_ keyPath: KeyPath<D, V>, isEqualTo null: Void?) where V : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + null + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality to nil

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<O>(_ keyPath: KeyPath<D, O>, isEqualTo null: Void?) where O : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + null + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<V>(_ keyPath: KeyPath<D, V>, isEqualTo value: V?) where V : QueryableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + value + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<O>(_ keyPath: KeyPath<D, O>, isEqualTo value: O?) where O : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + value + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<O>(_ keyPath: KeyPath<D, O>, isEqualTo objectID: NSManagedObjectID) where O : DynamicObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + objectID + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isMemberOf:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares membership

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<V, S>(_ keyPath: KeyPath<D, V>, isMemberOf list: S) where V : QueryableAttributeType, V == S.Element, S : Sequence
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + list + + +
    +

    the sequence to check membership of

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isMemberOf:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares membership

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<O, S>(_ keyPath: KeyPath<D, O>, isMemberOf list: S) where O : DynamicObject, O == S.Element, S : Sequence
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + list + + +
    +

    the sequence to check membership of

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isMemberOf:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares membership

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<O, S>(_ keyPath: KeyPath<D, O>, isMemberOf list: S) where O : DynamicObject, S : Sequence, S.Element : NSManagedObjectID
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + list + + +
    +

    the sequence to check membership of

    +
    +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality to nil

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<V>>, isEqualTo null: Void?) where V : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + null + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality to nil

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<O>(_ keyPath: KeyPath<D, RelationshipContainer<D>.ToOne<O>>, isEqualTo null: Void?) where O : CoreStoreObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + null + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Required<V>>, isEqualTo value: V?) where V : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + value + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<V>>, isEqualTo value: V?) where V : ImportableAttributeType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + value + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<O>(_ keyPath: KeyPath<D, RelationshipContainer<D>.ToOne<O>>, isEqualTo value: O?) where O : CoreStoreObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + value + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isEqualTo:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares equality

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<O>(_ keyPath: KeyPath<D, RelationshipContainer<D>.ToOne<O>>, isEqualTo objectID: NSManagedObjectID) where O : CoreStoreObject
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + objectID + + +
    +

    the arguments for the == operator

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isMemberOf:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares membership

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<V, S>(_ keyPath: KeyPath<D, ValueContainer<D>.Required<V>>, isMemberOf list: S) where V : ImportableAttributeType, V == S.Element, S : Sequence
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + list + + +
    +

    the sequence to check membership of

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isMemberOf:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares membership

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<V, S>(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<V>>, isMemberOf list: S) where V : ImportableAttributeType, V == S.Element, S : Sequence
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + list + + +
    +

    the sequence to check membership of

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isMemberOf:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares membership

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<O, S>(_ keyPath: KeyPath<D, RelationshipContainer<D>.ToOne<O>>, isMemberOf list: S) where O : CoreStoreObject, O == S.Element, S : Sequence
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + list + + +
    +

    the sequence to check membership of

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:isMemberOf:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause that compares membership

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<O, S>(_ keyPath: KeyPath<D, RelationshipContainer<D>.ToOne<O>>, isMemberOf list: S) where O : CoreStoreObject, S : Sequence, S.Element : NSManagedObjectID
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyPath + + +
    +

    the keyPath to compare with

    +
    +
    + + list + + +
    +

    the sequence to check membership of

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Initializes a Where clause from a closure

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ condition: (D) -> Where<D>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + condition + + +
    +

    closure that returns the Where clause

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Typealiases.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Typealiases.html new file mode 100644 index 0000000..94bc934 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/Typealiases.html @@ -0,0 +1,1006 @@ + + + + Type Aliases Reference + + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Type Aliases

+

The following type aliases are available globally.

+ +
+
+ +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    A String that pertains to the name of an *.xcdatamodeld file (without the file extension).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias XcodeDataModelFileName = String
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ModelConfiguration + +
    +
    +
    +
    +
    +
    +

    An Optional<String> that pertains to the name of a Configuration which particular groups of entities may belong to. When nil, pertains to the default configuration which includes all entities.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ModelConfiguration = String?
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ModelVersion + +
    +
    +
    +
    +
    +
    +

    An String that pertains to the name of a versioned *.xcdatamodeld file (without the file extension). Model version strings don’t necessarily have to be numeric or ordered in any way. The migration sequence will always be decided by (or the lack of) the MigrationChain.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ModelVersion = String
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + EntityName + +
    +
    +
    +
    +
    +
    +

    An String that pertains to an Entity name.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias EntityName = String
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + ClassName + +
    +
    +
    +
    +
    +
    +

    An String that pertains to a dynamically-accessable class name (usable with NSClassFromString(…)).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias ClassName = String
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + KeyPathString + +
    +
    +
    +
    +
    +
    +

    An String that pertains to a attribute keyPaths.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias KeyPathString = String
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/css/highlight.css b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/css/highlight.css new file mode 100644 index 0000000..d0db0e1 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/css/highlight.css @@ -0,0 +1,200 @@ +/* Credit to https://gist.github.com/wataru420/2048287 */ +.highlight { + /* Comment */ + /* Error */ + /* Keyword */ + /* Operator */ + /* Comment.Multiline */ + /* Comment.Preproc */ + /* Comment.Single */ + /* Comment.Special */ + /* Generic.Deleted */ + /* Generic.Deleted.Specific */ + /* Generic.Emph */ + /* Generic.Error */ + /* Generic.Heading */ + /* Generic.Inserted */ + /* Generic.Inserted.Specific */ + /* Generic.Output */ + /* Generic.Prompt */ + /* Generic.Strong */ + /* Generic.Subheading */ + /* Generic.Traceback */ + /* Keyword.Constant */ + /* Keyword.Declaration */ + /* Keyword.Pseudo */ + /* Keyword.Reserved */ + /* Keyword.Type */ + /* Literal.Number */ + /* Literal.String */ + /* Name.Attribute */ + /* Name.Builtin */ + /* Name.Class */ + /* Name.Constant */ + /* Name.Entity */ + /* Name.Exception */ + /* Name.Function */ + /* Name.Namespace */ + /* Name.Tag */ + /* Name.Variable */ + /* Operator.Word */ + /* Text.Whitespace */ + /* Literal.Number.Float */ + /* Literal.Number.Hex */ + /* Literal.Number.Integer */ + /* Literal.Number.Oct */ + /* Literal.String.Backtick */ + /* Literal.String.Char */ + /* Literal.String.Doc */ + /* Literal.String.Double */ + /* Literal.String.Escape */ + /* Literal.String.Heredoc */ + /* Literal.String.Interpol */ + /* Literal.String.Other */ + /* Literal.String.Regex */ + /* Literal.String.Single */ + /* Literal.String.Symbol */ + /* Name.Builtin.Pseudo */ + /* Name.Variable.Class */ + /* Name.Variable.Global */ + /* Name.Variable.Instance */ + /* Literal.Number.Integer.Long */ } + .highlight .c { + color: #999988; + font-style: italic; } + .highlight .err { + color: #a61717; + background-color: #e3d2d2; } + .highlight .k { + color: #000000; + font-weight: bold; } + .highlight .o { + color: #000000; + font-weight: bold; } + .highlight .cm { + color: #999988; + font-style: italic; } + .highlight .cp { + color: #999999; + font-weight: bold; } + .highlight .c1 { + color: #999988; + font-style: italic; } + .highlight .cs { + color: #999999; + font-weight: bold; + font-style: italic; } + .highlight .gd { + color: #000000; + background-color: #ffdddd; } + .highlight .gd .x { + color: #000000; + background-color: #ffaaaa; } + .highlight .ge { + color: #000000; + font-style: italic; } + .highlight .gr { + color: #aa0000; } + .highlight .gh { + color: #999999; } + .highlight .gi { + color: #000000; + background-color: #ddffdd; } + .highlight .gi .x { + color: #000000; + background-color: #aaffaa; } + .highlight .go { + color: #888888; } + .highlight .gp { + color: #555555; } + .highlight .gs { + font-weight: bold; } + .highlight .gu { + color: #aaaaaa; } + .highlight .gt { + color: #aa0000; } + .highlight .kc { + color: #000000; + font-weight: bold; } + .highlight .kd { + color: #000000; + font-weight: bold; } + .highlight .kp { + color: #000000; + font-weight: bold; } + .highlight .kr { + color: #000000; + font-weight: bold; } + .highlight .kt { + color: #445588; } + .highlight .m { + color: #009999; } + .highlight .s { + color: #d14; } + .highlight .na { + color: #008080; } + .highlight .nb { + color: #0086B3; } + .highlight .nc { + color: #445588; + font-weight: bold; } + .highlight .no { + color: #008080; } + .highlight .ni { + color: #800080; } + .highlight .ne { + color: #990000; + font-weight: bold; } + .highlight .nf { + color: #990000; } + .highlight .nn { + color: #555555; } + .highlight .nt { + color: #000080; } + .highlight .nv { + color: #008080; } + .highlight .ow { + color: #000000; + font-weight: bold; } + .highlight .w { + color: #bbbbbb; } + .highlight .mf { + color: #009999; } + .highlight .mh { + color: #009999; } + .highlight .mi { + color: #009999; } + .highlight .mo { + color: #009999; } + .highlight .sb { + color: #d14; } + .highlight .sc { + color: #d14; } + .highlight .sd { + color: #d14; } + .highlight .s2 { + color: #d14; } + .highlight .se { + color: #d14; } + .highlight .sh { + color: #d14; } + .highlight .si { + color: #d14; } + .highlight .sx { + color: #d14; } + .highlight .sr { + color: #009926; } + .highlight .s1 { + color: #d14; } + .highlight .ss { + color: #990073; } + .highlight .bp { + color: #999999; } + .highlight .vc { + color: #008080; } + .highlight .vg { + color: #008080; } + .highlight .vi { + color: #008080; } + .highlight .il { + color: #009999; } diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/css/jazzy.css b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/css/jazzy.css new file mode 100644 index 0000000..c83db5b --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/css/jazzy.css @@ -0,0 +1,368 @@ +*, *:before, *:after { + box-sizing: inherit; } + +body { + margin: 0; + background: #fff; + color: #333; + font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; + letter-spacing: .2px; + -webkit-font-smoothing: antialiased; + box-sizing: border-box; } + +h1 { + font-size: 2rem; + font-weight: 700; + margin: 1.275em 0 0.6em; } + +h2 { + font-size: 1.75rem; + font-weight: 700; + margin: 1.275em 0 0.3em; } + +h3 { + font-size: 1.5rem; + font-weight: 700; + margin: 1em 0 0.3em; } + +h4 { + font-size: 1.25rem; + font-weight: 700; + margin: 1.275em 0 0.85em; } + +h5 { + font-size: 1rem; + font-weight: 700; + margin: 1.275em 0 0.85em; } + +h6 { + font-size: 1rem; + font-weight: 700; + margin: 1.275em 0 0.85em; + color: #777; } + +p { + margin: 0 0 1em; } + +ul, ol { + padding: 0 0 0 2em; + margin: 0 0 0.85em; } + +blockquote { + margin: 0 0 0.85em; + padding: 0 15px; + color: #858585; + border-left: 4px solid #e5e5e5; } + +img { + max-width: 100%; } + +a { + color: #4183c4; + text-decoration: none; } + a:hover, a:focus { + outline: 0; + text-decoration: underline; } + +table { + background: #fff; + width: 100%; + border-collapse: collapse; + border-spacing: 0; + overflow: auto; + margin: 0 0 0.85em; } + +tr:nth-child(2n) { + background-color: #fbfbfb; } + +th, td { + padding: 6px 13px; + border: 1px solid #ddd; } + +pre { + margin: 0 0 1.275em; + padding: .85em 1em; + overflow: auto; + background: #f7f7f7; + font-size: .85em; + font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; } + +code { + font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; } + +p > code, li > code { + background: #f7f7f7; + padding: .2em; } + p > code:before, p > code:after, li > code:before, li > code:after { + letter-spacing: -.2em; + content: "\00a0"; } + +pre code { + padding: 0; + white-space: pre; } + +.content-wrapper { + display: flex; + flex-direction: column; } + @media (min-width: 768px) { + .content-wrapper { + flex-direction: row; } } + +.header { + display: flex; + padding: 8px; + font-size: 0.875em; + background: #444; + color: #999; } + +.header-col { + margin: 0; + padding: 0 8px; } + +.header-col--primary { + flex: 1; } + +.header-link { + color: #fff; } + +.header-icon { + padding-right: 6px; + vertical-align: -4px; + height: 16px; } + +.breadcrumbs { + font-size: 0.875em; + padding: 8px 16px; + margin: 0; + background: #fbfbfb; + border-bottom: 1px solid #ddd; } + +.carat { + height: 10px; + margin: 0 5px; } + +.navigation { + order: 2; } + @media (min-width: 768px) { + .navigation { + order: 1; + width: 25%; + max-width: 300px; + padding-bottom: 64px; + overflow: hidden; + word-wrap: normal; + background: #fbfbfb; + border-right: 1px solid #ddd; } } + +.nav-groups { + list-style-type: none; + padding-left: 0; } + +.nav-group-name { + border-bottom: 1px solid #ddd; + padding: 8px 0 8px 16px; } + +.nav-group-name-link { + color: #333; } + +.nav-group-tasks { + margin: 8px 0; + padding: 0 0 0 8px; } + +.nav-group-task { + font-size: 1em; + list-style-type: none; + white-space: nowrap; } + +.nav-group-task-link { + color: #808080; } + +.main-content { + order: 1; } + @media (min-width: 768px) { + .main-content { + order: 2; + flex: 1; + padding-bottom: 60px; } } + +.section { + padding: 0 32px; + border-bottom: 1px solid #ddd; } + +.section-content { + max-width: 834px; + margin: 0 auto; + padding: 16px 0; } + +.section-name { + color: #666; + display: block; } + +.declaration .highlight { + overflow-x: initial; + padding: 8px 0; + margin: 0; + background-color: transparent; + border: none; } + +.task-group-section { + border-top: 1px solid #ddd; } + +.task-group { + padding-top: 0px; } + +.task-name-container a[name]:before { + content: ""; + display: block; } + +.item-container { + padding: 0; } + +.item { + padding-top: 8px; + width: 100%; + list-style-type: none; } + .item a[name]:before { + content: ""; + display: block; } + .item .token { + padding-left: 3px; + margin-left: 0px; + font-size: 1rem; } + .item .declaration-note { + font-size: .85em; + color: #808080; + font-style: italic; } + +.pointer-container { + border-bottom: 1px solid #ddd; + left: -23px; + padding-bottom: 13px; + position: relative; + width: 110%; } + +.pointer { + left: 21px; + top: 7px; + display: block; + position: absolute; + width: 12px; + height: 12px; + border-left: 1px solid #ddd; + border-top: 1px solid #ddd; + background: #fff; + transform: rotate(45deg); } + +.height-container { + display: none; + position: relative; + width: 100%; + overflow: hidden; } + .height-container .section { + background: #fff; + border: 1px solid #ddd; + border-top-width: 0; + padding-top: 10px; + padding-bottom: 5px; + padding: 8px 16px; } + +.aside, .language { + padding: 6px 12px; + margin: 12px 0; + border-left: 5px solid #dddddd; + overflow-y: hidden; } + .aside .aside-title, .language .aside-title { + font-size: 9px; + letter-spacing: 2px; + text-transform: uppercase; + padding-bottom: 0; + margin: 0; + color: #aaa; + -webkit-user-select: none; } + .aside p:last-child, .language p:last-child { + margin-bottom: 0; } + +.language { + border-left: 5px solid #cde9f4; } + .language .aside-title { + color: #4183c4; } + +.aside-warning { + border-left: 5px solid #ff6666; } + .aside-warning .aside-title { + color: #ff0000; } + +.graybox { + border-collapse: collapse; + width: 100%; } + .graybox p { + margin: 0; + word-break: break-word; + min-width: 50px; } + .graybox td { + border: 1px solid #ddd; + padding: 5px 25px 5px 10px; + vertical-align: middle; } + .graybox tr td:first-of-type { + text-align: right; + padding: 7px; + vertical-align: top; + word-break: normal; + width: 40px; } + +.slightly-smaller { + font-size: 0.9em; } + +.footer { + padding: 8px 16px; + background: #444; + color: #ddd; + font-size: 0.8em; } + .footer p { + margin: 8px 0; } + .footer a { + color: #fff; } + +html.dash .header, html.dash .breadcrumbs, html.dash .navigation { + display: none; } +html.dash .height-container { + display: block; } + +form[role=search] input { + font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 24px; + padding: 0 10px; + margin: 0; + border: none; + border-radius: 1em; } + .loading form[role=search] input { + background: white url(../img/spinner.gif) center right 4px no-repeat; } +form[role=search] .tt-menu { + margin: 0; + min-width: 300px; + background: #fbfbfb; + color: #333; + border: 1px solid #ddd; } +form[role=search] .tt-highlight { + font-weight: bold; } +form[role=search] .tt-suggestion { + font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; + padding: 0 8px; } + form[role=search] .tt-suggestion span { + display: table-cell; + white-space: nowrap; } + form[role=search] .tt-suggestion .doc-parent-name { + width: 100%; + text-align: right; + font-weight: normal; + font-size: 0.9em; + padding-left: 16px; } +form[role=search] .tt-suggestion:hover, +form[role=search] .tt-suggestion.tt-cursor { + cursor: pointer; + background-color: #4183c4; + color: #fff; } +form[role=search] .tt-suggestion:hover .doc-parent-name, +form[role=search] .tt-suggestion.tt-cursor .doc-parent-name { + color: #fff; } diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/img/carat.png b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/img/carat.png new file mode 100755 index 0000000000000000000000000000000000000000..29d2f7fd4955fca6bc6fb740e0373a2c358c398e GIT binary patch literal 274 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRo!3HEV4DF?Wlw^r(L`iUdT1k0gQ7VIDN`6wR zf@f}GdTLN=VoGJ<$y6JlqAi{-jv*Ddl5#RKJQ5NTUZgiPI4RUKGIKU?u8L&ndhX1t za+0CMVUnT(Gnb}ei=c~x==tMH^F1_tBocXwcoSWoO-SZY-o>!8%^=Bms)(~h;m_U( zXNixk28L}0LS5-jKyq@#2gyS|J&f#pGCLkTc<@2s1dqeyqJ*Rc0tSIETAgmODY;(s z2y|Mcp&2}7rpBprBBB~1qM1`N+}4SoxYVPqsXi&l`rxZp{(w0iSy$Nv5*Vy!RapG^ S^0y4=eg;ohKbLh*2~7a!Pg}VF literal 0 HcmV?d00001 diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/img/dash.png b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/img/dash.png new file mode 100755 index 0000000000000000000000000000000000000000..6f694c7a012b417908da3687a0a39aa182e91c74 GIT binary patch literal 1338 zcmaJ>U2NM_6t){^r>#wcfL0VSTvuX@)$vd4#5N6WVkc|1rR}naMb)(7I5(};#!el# zbtCASsp?W-qE8zSJoFVdA%-T$WL8RI_B? zd+t5o`T5Q{p6=<|U$?VqCxRe#u}(PwSIl{LRKstfSbPYV7pzFiI$~t4QN;vEC}X4n z7RxDpAOV!j*w8ni4MAK3S~6v&;)g`l$axh<$7|>E5RD*h?RH*K2Y`j8L7%1v@%vZi za7@bt@uOUvisvQJuXPqpaHQCkREqd6M>0WG?6AwXR*T65ziuw$&~q$MS$o zfPyh>s<0l}mI@eh_hd(oB8*1tHZ@ojWl%QM;T+Jdm>k66jW?rZ#Atx!qns4-g&E4v z(=;FQ%W^avW?3J{L@2IeV>_(Ca)Lk1vm70uX*$9Rewm8!AxRF0BcZTNSFka?U@5u^ zDtpMY2lVtCmQm<8@|YxHuf`Qs(;a!QQ=g4=WngL}AQLr> z9JWrdsBIHKHXF!fSydodRsaOc@jgNkSU^x9kY&;UP<}3pZ{joC5f_Tevd>4eG~;)Y z=eZ~qp=5#aaUn*E3OES^BApKTU&mCAU>iEyt^S9?)&v0^j*SWDqjRZr20>6rTPSJ& zlzz0f);`}+^~w}lP1PK7Ew3f7ot#*uJ@>1Yo3J0TdsRKpA+*n9JnDXDrM~YvF`;uS|vAh|-QdmRf4AqG=`U z#v1n_Lxg8;&z#YCU2K`_W{-A zUf_|V)B9U(WZ~PP>)O(JZ|Vc-*qP&Q{c~BE~6izDPQq)#Nu*KOf(n^(VHY9;fiINM65``pc+9*v(mL$bwfCjbc%v9V{8r9iX|O%>Nr%pLD2qT{mty}c=LVleeamv znz3SOSm@kP8jThvOOq(56Yzh*fz(booe!uZij=BJC6+_lbvQ~B8nA2>kXdv_RDtRY z`5QXWWEySCe6vbTs^#f?J!WC*{1~RgVx!nJTJjQyO{dRANgx|FnymtGbD9%JmCh9^y)##j7{Dcqfn*1ta$rG89pJF6w-S7Z037$rr|y0;1Onp_ zGFJdT6Q!1C0AdVB0WOmpuV=AgAQ550Tn+-mivTtYPJmz*#75#_n9oV%!#rSOfmAfy zki%C~=fTp1{O#BLpJ|0jj#m6#|LRWit-vq3PE1z9ZqyvET4sX$-Icqy7t z<=aq5ff86AuBZBu6EjJsYWM0uejufWFTwPA7Su}0Bm$7KFb!q{Um_8~A{LUG#1l(l zSehUda@kU8LIRg9fkk2tZ;~ss5~R+mM<==F7hLHpxqLB>>PQS%Vc7b~?q!%T5+h8Q z4G=4Nzyi5WZ?^gkasJ{?Xhm`JC#WG6$1K2jb@=9&D3EgD#3UhGh#*21rJjulVXjCF zvp76q62jt0zzMG5C7DlfMgPl%C^3+~wf|}Lq=}jz|MmIcQjh1Ok6NjD$Em^Iv26D> z8tt_TnM9~^Tt8mflRGPOrrX|HtT3gG4LEuuk{g2Rn}QgJIa?gZo))!!=o_l9bvD%A zZ`aHajl8#~u?!4f7F#*b*->A=R2L)6!>saz?h>#wTXT-I(XmQ zx{84skS>k=i~i`(6k4C7;Zpfx%dCPVjPayMf8pugtGM=~s=Id1l#8MZJ1-73wV#Q3 zR3>v3%}jbQs1f_Z0xo;%=LILlA+nTpKI4ha%xWW}uqHrNao~&T4AY6m`P$_n-6h*g zhoX+e4n%~gl_lhe#s+AMb7d{5WzvYTa%6Q~si@@4{;s(0zU|H&P3fE+t{7X`S#Cj@ zC#vd}^4pcBD*77Ny5=j$h8EL2_t$O38$SQiJ6fPjJMimypr~MB2(&P0aI|h}$64<0 z>_~duqNjaT=DM^6+N{&B_lED;F2wrl?!4Lk*2((x!fmrcsw+=cI^qttuZ9C}-m~5E z-ryYVpL%^xR#&(0YI5hz<(}F7-p)?FPcyJO-zVO>%9ZDXJH8pnY;GJYFDQ>vd#j_* zRrd}L(r=!g+1#nQwsO?kpS`Qq8`NxE+Zy{gf7*_7J*U2V_|NpLo{iasj7VCg_V9&| ShohtYzipXxh2)4xTkMB!bsTr6|ge_{#vAVj^!DyNA-l zJ&$jDFNv;BTZXX@Qk-7+S5ErF>mkOcZ@lQv>F1VyCEMe2Ud@f<|L%#&QJi${E`2lR zqKFaW2Y$aTRxUY&ae$IHsN;Z;rdZ%CjYLTv!tMi234j-ON=CnvK-1QU|MG$YErn{gHZ@0Q6&?xSyply?S$EVNXH;gp?S5kV2-)$ga^gw`(f4Mm_Y(`RbgRkQTHF2@zL}dCiLk$RoZIc{xZL z_J*d5)Kb;#oKCFyfL*NGSs?y;e(QKvPJe1#G)h5*6E(?L9$nt?UaQJfP^$GDL0PU; z?r}C|);JQ4HES3w5VMlY7x6xfJAzDKlHE~>x;D`Fa=WygYot{pfFehH69o9pK|72W zwC6?t^AnATIJa=kewn=ep?Nk(aZ*pZo}51`S=^)jPRb`~l^VE}08>P3OJtQlXx1K8 z8Q}_u=F*fS;=k=?(fIv#+%811NTx8^}rHwvH%LbYmpFl9p1A{Idh@2x$ zuVp7)VD9}Uc(*(C**!QOdS(6B)$5^Tq5p3q*7un&_Z-NKEiEYg$D{Uq&sa>wj|za5 zJ6M~p)z+E6*X${8j6Ci+sqZ}zxeCAo0gZmZuhl+)Q%1U$Br_`NXcA-3yBdYMha+{o z{?q0Q(kaR2n`M29{!pwpgX6+CPQEgIO%x*0#!TC=c-ZPSkLO>OcmQUao5%-3w)U`F zRz?uGCEKQDh!TQPDmyd;iDX$TkMIe)%61q51Y2b-ie4r00!csilXgKL$txqj|6D(# z@(#!nQ}3R1JGeB3B5Tuqdvyg@*!-bq`9`pmasNGvy9^*+cd1Y*g>HK#rl7i79QQAG zl4SL_wW@WY1d+F?j0gFInGhsRrqvV3SKl{oqW+;9!fu|u@J)h4WM!0Cu02l@p60b#5M9c{dKh=_eRw~yl zWT0gw8RePzf%i8X&twiB|LF0bI@CYE{x1PI;Ylr4RJzU#Zc0j!c07g&q7=_eSd(sH z9VKChd?}^52IKcMqolAWiQH;HSp1Ploa$t zQhg|2sK;%Eb!By`)j9G1w?>`Wt6IK3gB}~uoue(MlRiIoZ#d{pgJZ8b{^{HO8)@%= zX)og3`*D5v1g;*Lz8@Sm(Q|&}PUytlb@Q_dzKFOzKK!Z_&?GO4+JO-)iPH=fs{(`& zZ9{oNn~LUZaeN!>i9p*0N^sHye8nw4xSi!REaP@@^Jy66|)Y9_AFoLlrlkg(42 zVq2J??I(+1*BcSKsTyO7LCho{8tVQm1b>*GQ*H~Mn71Lhy`alw%;D@CU^0)5Ng{cHz@LS7QZ o8uGHYt7)tmZjae5ge5$b`e_;HIklOseoIbqeod19BU-8d00{dbSpWb4 literal 0 HcmV?d00001 diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/index.html b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/index.html new file mode 100644 index 0000000..17764fc --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/index.html @@ -0,0 +1,2712 @@ + + + + CoreStore Reference + + + + + + + + + + + + + + + +
+

+ + CoreStore Docs + + (88% documented) +

+ +

+

+ +
+

+ +

+ + + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+ +

+CoreStore +
+
+Unleashing the real power of Core Data with the elegance and safety of Swift +
+
+Build Status +Platform +License +

Dependency managers
+Cocoapods compatible +Carthage compatible +Swift Package Manager compatible +

Contact
+Join us on Slack! +Reach me on Twitter! +
+

+ + + +

Upgrading from CoreStore 4.2 (Swift 3.2) to 5.x (Swift 4.x)? Check out the new features and make sure to read the Change logs.

+ +

CoreStore is now part of the Swift Source Compatibility projects.

+

Why use CoreStore?

+ +

CoreStore was (and is) heavily shaped by real-world needs of developing data-dependent apps. It enforces safe and convenient Core Data usage while letting you take advantage of the industry’s encouraged best practices.

+

Features

+ +
    +
  • 💎Tight design around Swift’s code elegance and type safety. CoreStore fully utilizes Swift’s community-driven language features.
  • +
  • 🚦Safer concurrency architecture. CoreStore makes it hard to fall into common concurrency mistakes. The main NSManagedObjectContext is strictly read-only, while all updates are done through serial transactions. (See Saving and processing transactions)
  • +
  • 🔍Clean fetching and querying API. Fetching objects is easy, but querying for raw aggregates (min, max, etc.) and raw property values is now just as convenient. (See Fetching and querying)
  • +
  • 🔭Type-safe, easy to configure observers. You don’t have to deal with the burden of setting up NSFetchedResultsControllers and KVO. As an added bonus, ListMonitors and ObjectMonitors can have multiple observers. This means you can have multiple view controllers efficiently share a single resource! (See Observing changes and notifications)
  • +
  • 📥Efficient importing utilities. Map your entities once with their corresponding import source (JSON for example), and importing from transactions becomes elegant. Uniquing is also done with an efficient find-and-replace algorithm. (See Importing data)
  • +
  • 🗑Say goodbye to .xcdatamodeld files! The new CoreStoreObject is the replacement to NSManagedObject. CoreStoreObject subclasses can declare type-safe properties all in Swift code, no need to maintain separate resource files for the models. As bonus, these special properties support custom types, and can be used to create type-safe keypaths and queries. (See Type-safe CoreStoreObjects)
  • +
  • 🔗Progressive migrations. No need to think how to migrate from all previous model versions to your latest model. Just tell the DataStack the sequence of version strings (MigrationChains) and CoreStore will automatically use progressive migrations when needed. (See Migrations)
  • +
  • Easier custom migrations. Say goodbye to .xcmappingmodel files; CoreStore can now infer entity mappings when possible, while still allowing an easy way to write custom mappings. (See Migrations)
  • +
  • 📝Plug-in your own logging framework. Although a default logger is built-in, all logging, asserting, and error reporting can be funneled to CoreStoreLogger protocol implementations. (See Logging and error reporting)
  • +
  • ⛓Heavy support for multiple persistent stores per data stack. CoreStore lets you manage separate stores in a single DataStack, just the way .xcdatamodeld configurations are designed to. CoreStore will also manage one stack by default, but you can create and manage as many as you need. (See Setting up)
  • +
  • 🎯Free to name entities and their class names independently. CoreStore gets around a restriction with other Core Data wrappers where the entity name should be the same as the NSManagedObject subclass name. CoreStore loads entity-to-class mappings from the managed object model file, so you can assign different names for the entities and their class names.
  • +
  • 📙Full Documentation. No magic here; all public classes, functions, properties, etc. have detailed Apple Docs. This README also introduces a lot of concepts and explains a lot of CoreStore’s behavior.
  • +
  • ℹ️Informative (and pretty) logs. All CoreStore and Core Data-related types now have very informative and pretty print outputs! (See Logging and error reporting)
  • +
  • 🎗Objective-C support! Is your project transitioning from Objective-C to Swift but still can’t quite fully convert some huge classes to Swift yet? CoreStore adjusts to the ever-increasing Swift adoption. While still written in pure Swift, all CoreStore types have their corresponding Objective-C-visible bridging classes. (See Objective-C support)
  • +
  • 🛡More extensive Unit Tests. Extending CoreStore is safe without having to worry about breaking old behavior.
  • +
+ +

Have ideas that may benefit other Core Data users? Feature Requests are welcome!

+

Contents

+ + +

TL;DR (a.k.a. sample codes)

+ +

Setting-up with progressive migration support:

+
CoreStore.defaultStack = DataStack(
+    xcodeModelName: "MyStore",
+    migrationChain: ["MyStore", "MyStoreV2", "MyStoreV3"]
+)
+
+ +

Adding a store:

+
CoreStore.addStorage(
+    SQLiteStore(fileName: "MyStore.sqlite"),
+    completion: { (result) -> Void in
+        // ...
+    }
+)
+
+ +

Starting transactions:

+
CoreStore.perform(
+    asynchronous: { (transaction) -> Void in
+        let person = transaction.create(Into<MyPersonEntity>())
+        person.name = "John Smith"
+        person.age = 42
+    },
+    completion: { (result) -> Void in
+        switch result {
+        case .success: print("success!")
+        case .failure(let error): print(error)
+        }
+    }
+)
+
+ +

Fetching objects (simple):

+
let people = CoreStore.fetchAll(From<MyPersonEntity>())
+
+ +

Fetching objects (complex):

+
let people = CoreStore.fetchAll(
+    From<MyPersonEntity>()
+        .where(\.age > 30),
+        .orderBy(.ascending(\.name), .descending(.\age)),
+        .tweak({ $0.includesPendingChanges = false })
+)
+
+ +

Querying values:

+
let maxAge = CoreStore.queryValue(
+    From<MyPersonEntity>()
+        .select(Int.self, .maximum(\.age))
+)
+
+ +

But really, there’s a reason I wrote this huge README. Read up on the details!

+ +

Check out the CoreStoreDemo app project for sample codes as well!

+

Architecture

+ +

For maximum safety and performance, CoreStore will enforce coding patterns and practices it was designed for. (Don’t worry, it’s not as scary as it sounds.) But it is advisable to understand the magic of CoreStore before you use it in your apps.

+ +

If you are already familiar with the inner workings of CoreData, here is a mapping of CoreStore abstractions:

+ + + + + + + + + + + + + + + + + + + +
Core DataCoreStore
NSManagedObjectModel / NSPersistentStoreCoordinator
(.xcdatamodeld file)
DataStack
NSPersistentStore
(Configurations in the .xcdatamodeld file)
StorageInterface implementations
(InMemoryStore, SQLiteStore, ICloudStore)
NSManagedObjectContextBaseDataTransaction subclasses
(SynchronousDataTransaction, AsynchronousDataTransaction, UnsafeDataTransaction)
+ +

A lot of Core Data wrapper libraries set up their NSManagedObjectContexts this way:

+ +

nested contexts

+ +

Nesting saves from child context to the root context ensures maximum data integrity between contexts without blocking the main queue. But in reality, merging contexts is still by far faster than saving contexts. CoreStore’s DataStack takes the best of both worlds by treating the main NSManagedObjectContext as a read-only context, and only allows changes to be made within transactions on the child context:

+ +

nested contexts and merge hybrid

+ +

This allows for a butter-smooth main thread, while still taking advantage of safe nested contexts.

+

Setting up

+ +

The simplest way to initialize CoreStore is to add a default store to the default stack:

+
try CoreStore.addStorageAndWait()
+
+ +

This one-liner does the following:

+ +
    +
  • Triggers the lazy-initialization of CoreStore.defaultStack with a default DataStack
  • +
  • Sets up the stack’s NSPersistentStoreCoordinator, the root saving NSManagedObjectContext, and the read-only main NSManagedObjectContext
  • +
  • Adds an SQLiteStore in the Application Support/ directory (or the Caches/ directory on tvOS) with the file name [App bundle name].sqlite
  • +
  • Creates and returns the NSPersistentStore instance on success, or an NSError on failure
  • +
+ +

For most cases, this configuration is enough as it is. But for more hardcore settings, refer to this extensive example:

+
let dataStack = DataStack(
+    xcodeModelName: "MyModel", // loads from the "MyModel.xcdatamodeld" file
+    migrationChain: ["MyStore", "MyStoreV2", "MyStoreV3"] // model versions for progressive migrations
+)
+let migrationProgress = dataStack.addStorage(
+    SQLiteStore(
+        fileURL: sqliteFileURL, // set the target file URL for the sqlite file
+        configuration: "Config2", // use entities from the "Config2" configuration in the .xcdatamodeld file
+        localStorageOptions: .recreateStoreOnModelMismatch // if migration paths cannot be resolved, recreate the sqlite file
+    ),
+    completion: { (result) -> Void in
+        switch result {
+        case .success(let storage):
+            print("Successfully added sqlite store: \(storage)")
+        case .failure(let error):
+            print("Failed adding sqlite store with error: \(error)")
+        }
+    }
+)
+
+CoreStore.defaultStack = dataStack // pass the dataStack to CoreStore for easier access later on
+
+ +
+

💡If you have never heard of Configurations, you’ll find them in your .xcdatamodeld file +xcode configurations screenshot

+
+ +

In our sample code above, note that you don’t need to do the CoreStore.defaultStack = dataStack line. You can just as well hold a reference to the DataStack like below and call all its instance methods directly:

+
class MyViewController: UIViewController {
+    let dataStack = DataStack(xcodeModelName: "MyModel") // keep reference to the stack
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        do {
+            try self.dataStack.addStorageAndWait(SQLiteStore.self)
+        }
+        catch { // ...
+        }
+    }
+    func methodToBeCalledLaterOn() {
+        let objects = self.dataStack.fetchAll(From(MyEntity))
+        print(objects)
+    }
+}
+
+ +

The difference is when you set the stack as the CoreStore.defaultStack, you can call the stack’s methods directly from CoreStore itself:

+
class MyViewController: UIViewController {
+    // elsewhere: CoreStore.defaultStack = DataStack(modelName: "MyModel")
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        do {
+            try CoreStore.addStorageAndWait(SQLiteStore.self)
+        }
+        catch { // ...
+        }
+    }
+    func methodToBeCalledLaterOn() {
+        let objects = CoreStore.fetchAll(From<MyEntity>())
+        print(objects)
+    }
+}
+
+ +
+

💡By default, CoreStore will initialize NSManagedObjects from .xcdatamodeld files, but you can create models completely from source code using CoreStoreObjects and CoreStoreSchema. To use this feature, refer to Type-safe CoreStoreObjects.

+
+ +

Notice that in our previous examples, addStorageAndWait(_:) and addStorage(_:completion:) both accept either InMemoryStore, SQLiteStore, or ICloudStore. These implement the StorageInterface protocol.

+

In-memory store

+ +

The most basic StorageInterface concrete type is the InMemoryStore, which just stores objects in memory. Since InMemoryStores always start with a fresh empty data, they do not need any migration information.

+
try CoreStore.addStorageAndWait(
+    InMemoryStore(
+        configuration: "Config2" // optional. Use entities from the "Config2" configuration in the .xcdatamodeld file
+    )
+)
+
+

Local Store

+ +

The most common StorageInterface you will probably use is the SQLiteStore, which saves data in a local SQLite file.

+
let migrationProgress = CoreStore.addStorage(
+    SQLiteStore(
+        fileName: "MyStore.sqlite",
+        configuration: "Config2", // optional. Use entities from the "Config2" configuration in the .xcdatamodeld file
+        migrationMappingProviders: [Bundle.main], // optional. The bundles that contain required .xcmappingmodel files
+        localStorageOptions: .recreateStoreOnModelMismatch // optional. Provides settings that tells the DataStack how to setup the persistent store
+    ),
+    completion: { /* ... */ }
+)
+
+ +

Refer to the SQLiteStore.swift source documentation for detailed explanations for each of the default values.

+ +

CoreStore can decide the default values for these properties, so SQLiteStores can be initialized with no arguments:

+
try CoreStore.addStorageAndWait(SQLiteStore())
+
+ +

The file-related properties above are actually requirements of another protocol that SQLiteStore implements, the LocalStorage protocol:

+
public protocol LocalStorage: StorageInterface {
+    var fileURL: NSURL { get }
+    var migrationMappingProviders: [SchemaMappingProvider] { get }
+    var localStorageOptions: LocalStorageOptions { get }
+    func dictionary(forOptions: LocalStorageOptions) -> [String: AnyObject]?
+    func cs_eraseStorageAndWait(metadata: [String: Any], soureModelHint: NSManagedObjectModel?) throws
+}
+
+ +

If you have custom NSIncrementalStore or NSAtomicStore subclasses, you can implement this protocol and use it similarly to SQLiteStore.

+

iCloud Store

+ +
+

⚠️Important: The iCloud Store is being deprecated. Please use with caution. If you have any concerns please do send me a message on Twitter or on the CoreStore Slack Team

+
+ +

As a counterpart to LocalStorage, the CloudStorage protocol abstracts stores managed in the cloud. CoreStore currently provides the concrete class ICloudStore. Unlike InMemoryStore and SQLiteStore though, the ICloudStore‘s initializer may return nil if the iCloud container could not be located or if iCloud is not available on the device:

+
guard let storage = ICloudStore(
+    ubiquitousContentName: "MyAppCloudData", // the name of the store in iCloud
+    ubiquitousContentTransactionLogsSubdirectory: "logs/config1", // optional. Subdirectory path for the transaction logs
+    ubiquitousContainerID: "iCloud.com.mycompany.myapp.containername", // optional. The container if your app has multiple ubiquity container identifiers in its entitlements
+    ubiquitousPeerToken: "9614d658014f4151a95d8048fb717cf0", // optional. A per-application salt to allow multiple apps on the same device to share a Core Data store integrated with iCloud
+    configuration: "Config1", // optional. Use entities from the "Config1" configuration in the .xcdatamodeld file
+    cloudStorageOptions: .recreateLocalStoreOnModelMismatch // optional. Provides settings that tells the DataStack how to setup the persistent store
+) else {
+    // The iCloud container could not be located or if iCloud is not available on the device.
+    // Handle appropriately
+    return    
+}
+CoreStore.addStorage(,
+    storage,
+    completion: { result in
+        switch result {
+        case .success(let storage): // ...
+        case .failure(let error): // ...
+        }
+    }
+)
+
+ +

If your app is using iCloud stores, you may want to be notified of particular iCloud events. The ICloudStoreObserver functions are all optional, so you may implement only the ones your app is interested in:

+
public protocol ICloudStoreObserver: class {
+    func iCloudStoreWillFinishUbiquitousStoreInitialImport(storage storage: ICloudStore, dataStack: DataStack)
+    func iCloudStoreDidFinishUbiquitousStoreInitialImport(storage storage: ICloudStore, dataStack: DataStack)
+    func iCloudStoreWillAddAccount(storage storage: ICloudStore, dataStack: DataStack)
+    func iCloudStoreDidAddAccount(storage storage: ICloudStore, dataStack: DataStack)
+    func iCloudStoreWillRemoveAccount(storage storage: ICloudStore, dataStack: DataStack)
+    func iCloudStoreDidRemoveAccount(storage storage: ICloudStore, dataStack: DataStack)
+    func iCloudStoreWillRemoveContent(storage storage: ICloudStore, dataStack: DataStack)
+    func iCloudStoreDidRemoveContent(storage storage: ICloudStore, dataStack: DataStack)
+}
+
+ +

To register your ICloudStoreObserver, call addObserver(_:) on the ICloudStore instance:

+
guard let storage = ICloudStore(/* ... */) else {
+    return    
+}
+storage.addObserver(self) // assuming self implements ICloudStoreObserver
+CoreStore.addStorage(,
+    storage,
+    completion: { result in
+        switch result {
+        case .success(let storage): // ... You may also call storage.addObserver(_:) here
+        case .failure(let error): // ...
+        }
+    }
+)
+
+ +

The ICloudStore only keeps weak references of the registered observers. You may call removeObserver(_:) for precise deregistration, but ICloudStore automatically removes deallocated observers.

+

Migrations

+

Declaring model versions

+ +

Until CoreStore 4.0, model versions were always assumed to be declared in .xcdatamodeld files. The DataStack loads these for us by accepting the .xcdatamodeld file name and the Bundle where the files can be found:

+
CoreStore.defaultStack = DataStack(
+    xcodeModelName: "MyModel",
+    bundle: Bundle.main,
+    migrationChain: ["MyAppModel", "MyAppModelV2", "MyAppModelV3", "MyAppModelV4"]
+)
+
+ +

Starting CoreStore 4.0, model versions are now expressed as a first-class protocol, DynamicSchema. CoreStore currently supports the following schema classes:

+ + + +

All the DynamicSchema for all model versions are then collected within a single SchemaHistory instance, which is then handed to the DataStack. Here are some common use cases:

+ +

Multiple model versions grouped in a .xcdatamodeld file (Core Data standard method)

+
CoreStore.defaultStack = DataStack(
+    xcodeModelName: "MyModel",
+    bundle: Bundle.main,
+    migrationChain: ["MyAppModel", "MyAppModelV2", "MyAppModelV3", "MyAppModelV4"]
+)
+
+ +

CoreStoreSchema-based model version (No .xcdatamodeld file needed) +(For more details, see also Type-safe CoreStoreObjects)

+
class Animal: CoreStoreObject {
+    // ...
+}
+class Dog: Animal {
+    // ...
+}
+class Person: CoreStoreObject {
+    // ...
+}
+
+CoreStore.defaultStack = DataStack(
+    CoreStoreSchema(
+        modelVersion: "V1",
+        entities: [
+            Entity<Animal>("Animal", isAbstract: true),
+            Entity<Dog>("Dog"),
+            Entity<Person>("Person")
+        ]
+    )
+)
+
+ +

Models in a .xcdatamodeld file during past app versions, but migrated to the new CoreStoreSchema method

+
class Animal: CoreStoreObject {
+    // ...
+}
+class Dog: Animal {
+    // ...
+}
+class Person: CoreStoreObject {
+    // ...
+}
+
+let legacySchema = XcodeDataModelSchema.from(
+    modelName: "MyModel", // .xcdatamodeld name
+    bundle: bundle,
+    migrationChain: ["MyAppModel", "MyAppModelV2", "MyAppModelV3", "MyAppModelV4"]
+)
+let newSchema = CoreStoreSchema(
+    modelVersion: "V1",
+    entities: [
+        Entity<Animal>("Animal", isAbstract: true),
+        Entity<Dog>("Dog"),
+        Entity<Person>("Person")
+    ]
+)
+CoreStore.defaultStack = DataStack(
+    schemaHistory: SchemaHistory(
+        legacySchema + [newSchema],
+        migrationChain: ["MyAppModel", "MyAppModelV2", "MyAppModelV3", "MyAppModelV4", "V1"] 
+    )
+)   
+
+ +

CoreStoreSchema-based model versions with progressive migration

+
typealias Animal = V2.Animal
+typealias Dog = V2.Dog
+typealias Person = V2.Person
+enum V2 {
+    class Animal: CoreStoreObject {
+        // ...
+    }
+    class Dog: Animal {
+        // ...
+    }
+    class Person: CoreStoreObject {
+        // ...
+    }
+}
+enum V1 {
+    class Animal: CoreStoreObject {
+        // ...
+    }
+    class Dog: Animal {
+        // ...
+    }
+    class Person: CoreStoreObject {
+        // ...
+    }
+}
+
+CoreStore.defaultStack = DataStack(
+    CoreStoreSchema(
+        modelVersion: "V1",
+        entities: [
+            Entity<V1.Animal>("Animal", isAbstract: true),
+            Entity<V1.Dog>("Dog"),
+            Entity<V1.Person>("Person")
+        ]
+    ),
+    CoreStoreSchema(
+        modelVersion: "V2",
+        entities: [
+            Entity<V2.Animal>("Animal", isAbstract: true),
+            Entity<V2.Dog>("Dog"),
+            Entity<V2.Person>("Person")
+        ]
+    ),
+    migrationChain: ["V1", "V2"]
+)
+
+

Starting migrations

+ +

We have seen addStorageAndWait(...) used to initialize our persistent store. As the method name’s ~AndWait suffix suggests though, this method blocks so it should not do long tasks such as store migrations. In fact CoreStore will only attempt a synchronous lightweight migration if you explicitly provide the .allowSynchronousLightweightMigration option:

+
try dataStack.addStorageAndWait(
+    SQLiteStore(
+        fileURL: sqliteFileURL,
+        localStorageOptions: .allowSynchronousLightweightMigration
+    )
+}
+
+ +

if you do so, any model mismatch will be thrown as an error.

+ +

In general though, if migrations are expected the asynchronous variant addStorage(_:completion:) method is recommended instead:

+
let migrationProgress: Progress? = try dataStack.addStorage(
+    SQLiteStore(
+        fileName: "MyStore.sqlite",
+        configuration: "Config2"
+    ),
+    completion: { (result) -> Void in
+        switch result {
+        case .success(let storage):
+            print("Successfully added sqlite store: \(storage)")
+        case .failure(let error):
+            print("Failed adding sqlite store with error: \(error)")
+        }
+    }
+)
+
+ +

The completion block reports a SetupResult that indicates success or failure.

+ +

Notice that this method also returns an optional Progress. If nil, no migrations are needed, thus progress reporting is unnecessary as well. If not nil, you can use this to track migration progress by using standard KVO on the "fractionCompleted" key, or by using a closure-based utility exposed in Progress+Convenience.swift:

+
migrationProgress?.setProgressHandler { [weak self] (progress) -> Void in
+    self?.progressView?.setProgress(Float(progress.fractionCompleted), animated: true)
+    self?.percentLabel?.text = progress.localizedDescription // "50% completed"
+    self?.stepLabel?.text = progress.localizedAdditionalDescription // "0 of 2"
+}
+
+ +

This closure is executed on the main thread so UIKit and AppKit calls can be done safely.

+

Progressive migrations

+ +

By default, CoreStore uses Core Data’s default automatic migration mechanism. In other words, CoreStore will try to migrate the existing persistent store until it matches the SchemaHistory’s currentModelVersion. If no mapping model path is found from the store’s version to the data model’s version, CoreStore gives up and reports an error.

+ +

The DataStack lets you specify hints on how to break a migration into several sub-migrations using a MigrationChain. This is typically passed to the DataStack initializer and will be applied to all stores added to the DataStack with addSQLiteStore(...) and its variants:

+
let dataStack = DataStack(migrationChain: 
+    ["MyAppModel", "MyAppModelV2", "MyAppModelV3", "MyAppModelV4"])
+
+ +

The most common usage is to pass in the model version (.xcdatamodeld version names for NSManagedObjects, or the modelName for CoreStoreSchemas) in increasing order as above.

+ +

For more complex, non-linear migration paths, you can also pass in a version tree that maps the key-values to the source-destination versions:

+
let dataStack = DataStack(migrationChain: [
+    "MyAppModel": "MyAppModelV3",
+    "MyAppModelV2": "MyAppModelV4",
+    "MyAppModelV3": "MyAppModelV4"
+])
+
+ +

This allows for different migration paths depending on the starting version. The example above resolves to the following paths:

+ +
    +
  • MyAppModel-MyAppModelV3-MyAppModelV4
  • +
  • MyAppModelV2-MyAppModelV4
  • +
  • MyAppModelV3-MyAppModelV4
  • +
+ +

Initializing with empty values (either nil, [], or [:]) instructs the DataStack to disable progressive migrations and revert to the default migration behavior (i.e. use the .xcdatamodeld’s current version as the final version):

+
let dataStack = DataStack(migrationChain: nil)
+
+ +

The MigrationChain is validated when passed to the DataStack and unless it is empty, will raise an assertion if any of the following conditions are met:

+ +
    +
  • a version appears twice in an array
  • +
  • a version appears twice as a key in a dictionary literal
  • +
  • a loop is found in any of the paths
  • +
+ +
+

⚠️Important: If a MigrationChain is specified, the .xcdatamodeld’s Current Version will be bypassed and the MigrationChain’s leafmost version will be the DataStack’s base model version.

+
+

Forecasting migrations

+ +

Sometimes migrations are huge and you may want prior information so your app could display a loading screen, or to display a confirmation dialog to the user. For this, CoreStore provides a requiredMigrationsForStorage(_:) method you can use to inspect a persistent store before you actually call addStorageAndWait(_:) or addStorage(_:completion:):

+
do {
+    let storage = SQLiteStorage(fileName: "MyStore.sqlite")
+    let migrationTypes: [MigrationType] = try CoreStore.requiredMigrationsForStorage(storage)
+    if migrationTypes.count > 1
+        || (migrationTypes.filter { $0.isHeavyweightMigration }.count) > 0 {
+        // ... will migrate more than once. Show special waiting screen
+    }
+    else if migrationTypes.count > 0 {
+        // ... will migrate just once. Show simple activity indicator
+    }
+    else {
+        // ... Do nothing
+    }
+    CoreStore.addStorage(storage, completion: { /* ... */ })
+}
+catch {
+    // ... either inspection of the store failed, or if no mapping model was found/inferred
+}
+
+ +

requiredMigrationsForStorage(_:) returns an array of MigrationTypes, where each item in the array may be either of the following values:

+
case lightweight(sourceVersion: String, destinationVersion: String)
+case heavyweight(sourceVersion: String, destinationVersion: String)
+
+ +

Each MigrationType indicates the migration type for each step in the MigrationChain. Use these information as fit for your app.

+

Custom migrations

+ +

Before CoreStore 4.0, the only way to implement custom migrations is to use Core Data’s standard method: declaring entity mappings through .xcmappingmodel files. Starting CoreStore 4.0, new ways to declare migration mappings have been added:

+ +
    +
  • InferredSchemaMappingProvider: The default mapping provider which tries to infer model migration between two DynamicSchema versions either by searching all .xcmappingmodel files from Bundle.allBundles, or by relying on lightweight migration if possible.
  • +
  • XcodeSchemaMappingProvider: A mapping provider which loads entity mappings from .xcmappingmodel files in a specified Bundle.
  • +
  • CustomSchemaMappingProvider: A mapping provider that infers mapping initially, but also accepts custom mappings for specified entities. This was added to support custom migrations with CoreStoreObjects as well, but may also be used with NSManagedObjects.
  • +
+ +

These mapping providers conform to SchemaMappingProvider and can be passed to SQLiteStore’s initializer:

+
let dataStack = DataStack(migrationChain: ["MyAppModel", "MyAppModelV2", "MyAppModelV3", "MyAppModelV4"])
+_ = try dataStack.addStorage(
+    SQLiteStore(
+        fileName: "MyStore.sqlite",
+        migrationMappingProviders: [
+            XcodeSchemaMappingProvider(from: "V1", to: "V2", mappingModelBundle: Bundle.main),
+            CustomSchemaMappingProvider(from: "V2", to: "V3", entityMappings: [.deleteEntity("Person") ])
+        ]
+    ),
+    completion: { (result) -> Void in
+        // ...
+    }
+)
+
+ +

For version migrations present in the DataStack’s MigrationChain but not handled by any of the SQLiteStore’s migrationMappingProviders array, CoreStore will automatically try to use InferredSchemaMappingProvider as fallback. Finally if the InferredSchemaMappingProvider could not resolve any mapping, the migration will fail and the DataStack.addStorage(...) method will report the failure.

+ +

For CustomSchemaMappingProvider, more granular updates are supported through the dynamic objects UnsafeSourceObject and UnsafeDestinationObject. The example below allows the migration to conditionally ignore some objects:

+
let person_v2_to_v3_mapping = CustomSchemaMappingProvider(
+    from: "V2",
+    to: "V3",
+    entityMappings: [
+        .transformEntity(
+            sourceEntity: "Person",
+            destinationEntity: "Person",
+            transformer: { (sourceObject: UnsafeSourceObject, createDestinationObject: () -> UnsafeDestinationObject) in
+
+                if (sourceObject["isVeryOldAccount"] as! Bool?) == true {
+                    return // this account is too old, don't migrate 
+                }
+                // migrate the rest
+                let destinationObject = createDestinationObject()
+                destinationObject.enumerateAttributes { (attribute, sourceAttribute) in
+
+                if let sourceAttribute = sourceAttribute {
+                    destinationObject[attribute] = sourceObject[sourceAttribute]
+                }
+            }
+        ) 
+    ]
+)
+SQLiteStore(
+    fileName: "MyStore.sqlite",
+    migrationMappingProviders: [person_v2_to_v3_mapping]
+)
+
+ +

The UnsafeSourceObject is a read-only proxy for an object existing in the source model version. The UnsafeDestinationObject is a read-write object that is inserted (optionally) to the destination model version. Both classes’ properties are accessed through key-value-coding.

+

Saving and processing transactions

+ +

To ensure deterministic state for objects in the read-only NSManagedObjectContext, CoreStore does not expose API’s for updating and saving directly from the main context (or any other context for that matter.) Instead, you spawn transactions from DataStack instances:

+
let dataStack = self.dataStack
+dataStack.perform(
+    asynchronous: { (transaction) -> Void in
+        // make changes
+    },
+    completion: { (result) -> Void in
+        // ...
+    }
+)
+
+ +

or for the default stack, directly from CoreStore:

+
CoreStore.perform(
+    asynchronous: { (transaction) -> Void in
+        // make changes
+    },
+    completion: { (result) -> Void in
+        // ...
+    }
+)
+
+ +

Transaction blocks automatically save changes once the block completes. To cancel and rollback a transaction, throw a CoreStoreError.userCancelled from inside the closure by calling try transaction.cancel():

+
dataStack.perform(
+    asynchronous: { (transaction) -> Void in
+        // ...
+        if shouldCancel {
+            try transaction.cancel()
+        }
+        // ...
+    },
+    completion: { (result) -> Void in
+        if case .failure(.userCancelled) = result {
+            // ... cancelled
+        }
+    }
+)
+
+ +
+

⚠️Important: Never use try? or try! on a transaction.cancel() call. Always use try. Using try? will swallow the cancellation and the transaction will proceed to save as normal. Using try! will crash the app as transaction.cancel() will always throw an error.

+
+ +

The examples above use perform(asynchronous:...), but there are actually 3 types of transactions at your disposal: asynchronous, synchronous, and unsafe.

+

Transaction types

+

Asynchronous transactions

+ +

are spawned from perform(asynchronous:...). This method returns immediately and executes its closure from a background serial queue. The return value for the closure is declared as a generic type, so any value returned from the closure can be passed to the completion result:

+
CoreStore.perform(
+    asynchronous: { (transaction) -> Bool in
+        // make changes
+        return transaction.hasChanges
+    },
+    completion: { (result) -> Void in
+        switch result {
+        case .success(let hasChanges): print("success! Has changes? \(hasChanges)")
+        case .failure(let error): print(error)
+        }
+    }
+)
+
+ +

The success and failure can also be declared as separate handlers:

+
CoreStore.perform(
+    asynchronous: { (transaction) -> Int in
+        // make changes
+        return transaction.delete(objects)
+    },
+    success: { (numberOfDeletedObjects: Int) -> Void in
+        print("success! Deleted \(numberOfDeletedObjects) objects")
+    },
+    failure: { (error) -> Void in
+        print(error)
+    }
+)
+
+ +
+

⚠️Be careful when returning NSManagedObjects or CoreStoreObjects from the transaction closure. Those instances are for the transaction’s use only. See Passing objects safely.

+
+ +

Transactions created from perform(asynchronous:...) are instances of AsynchronousDataTransaction.

+

Synchronous transactions

+ +

are created from perform(synchronous:...). While the syntax is similar to its asynchronous counterpart, perform(synchronous:...) waits for its transaction block to complete before returning:

+
let hasChanges = CoreStore.perform(
+    synchronous: { (transaction) -> Bool in
+        // make changes
+        return transaction.hasChanges
+    }
+)
+
+ +

transaction above is a SynchronousDataTransaction instance.

+ +

Since perform(synchronous:...) technically blocks two queues (the caller’s queue and the transaction’s background queue), it is considered less safe as it’s more prone to deadlock. Take special care that the closure does not block on any other external queues.

+ +

By default, perform(synchronous:...) will wait for observers such as ListMonitors to be notified before the method returns. This may cause deadlocks, especially if you are calling this from the main thread. To reduce this risk, you may try to set the waitForAllObservers: parameter to false. Doing so tells the SynchronousDataTransaction to block only until it completes saving. It will not wait for other context’s to receive those changes. This reduces deadlock risk but may have surprising side-effects:

+
CoreStore.perform(
+    synchronous: { (transaction) in
+        let person = transaction.create(Into<Person>())
+        person.name = "John"
+    },
+    waitForAllObservers: false
+)
+let newPerson = CoreStore.fetchOne(From<Person>.where(\.name == "John"))
+// newPerson may be nil!
+// The DataStack may have not yet received the update notification.
+
+ +

Due to this complicated nature of synchronous transactions, if your app has very heavy transaction throughput it is highly recommended to use asynchronous transactions instead.

+

Unsafe transactions

+ +

are special in that they do not enclose updates within a closure:

+
let transaction = CoreStore.beginUnsafe()
+// make changes
+downloadJSONWithCompletion({ (json) -> Void in
+
+    // make other changes
+    transaction.commit()
+})
+downloadAnotherJSONWithCompletion({ (json) -> Void in
+
+    // make some other changes
+    transaction.commit()
+})
+
+ +

This allows for non-contiguous updates. Do note that this flexibility comes with a price: you are now responsible for managing concurrency for the transaction. As uncle Ben said, with great power comes great race conditions.

+ +

As the above example also shows, with unsafe transactions commit() can be called multiple times.

+ +

You’ve seen how to create transactions, but we have yet to see how to make creates, updates, and deletes. The 3 types of transactions above are all subclasses of BaseDataTransaction, which implements the methods shown below.

+

Creating objects

+ +

The create(...) method accepts an Into clause which specifies the entity for the object you want to create:

+
let person = transaction.create(Into<MyPersonEntity>())
+
+ +

While the syntax is straightforward, CoreStore does not just naively insert a new object. This single line does the following:

+ +
    +
  • Checks that the entity type exists in any of the transaction’s parent persistent store
  • +
  • If the entity belongs to only one persistent store, a new object is inserted into that store and returned from create(...)
  • +
  • If the entity does not belong to any store, an assertion failure will be raised. This is a programmer error and should never occur in production code.
  • +
  • If the entity belongs to multiple stores, an assertion failure will be raised. This is also a programmer error and should never occur in production code. Normally, with Core Data you can insert an object in this state but saving the NSManagedObjectContext will always fail. CoreStore checks this for you at creation time when it makes sense (not during save).
  • +
+ +

If the entity exists in multiple configurations, you need to provide the configuration name for the destination persistent store:

+
let person = transaction.create(Into<MyPersonEntity>("Config1"))
+
+ +

or if the persistent store is the auto-generated Default configuration, specify nil:

+
let person = transaction.create(Into<MyPersonEntity>(nil))
+
+ +

Note that if you do explicitly specify the configuration name, CoreStore will only try to insert the created object to that particular store and will fail if that store is not found; it will not fall back to any other configuration that the entity belongs to.

+

Updating objects

+ +

After creating an object from the transaction, you can simply update its properties as normal:

+
CoreStore.perform(
+    asynchronous: { (transaction) -> Void in
+        let person = transaction.create(Into<MyPersonEntity>())
+        person.name = "John Smith"
+        person.age = 30
+    },
+    completion: { _ in }
+)
+
+ +

To update an existing object, fetch the object’s instance from the transaction:

+
CoreStore.perform(
+    asynchronous: { (transaction) -> Void in
+        let person = transaction.fetchOne(
+            From<MyPersonEntity>()
+                .where(\.name == "Jane Smith")
+        )
+        person.age = person.age + 1
+    },
+    completion: { _ in }
+)
+
+ +

(For more about fetching, see Fetching and querying)

+ +

Do not update an instance that was not created/fetched from the transaction. If you have a reference to the object already, use the transaction’s edit(...) method to get an editable proxy instance for that object:

+
let jane: MyPersonEntity = // ...
+
+CoreStore.perform(
+    asynchronous: { (transaction) -> Void in
+        // WRONG: jane.age = jane.age + 1
+        // RIGHT:
+        let jane = transaction.edit(jane)! // using the same variable name protects us from misusing the non-transaction instance
+        jane.age = jane.age + 1
+    },
+    completion: { _ in }
+)
+
+ +

This is also true when updating an object’s relationships. Make sure that the object assigned to the relationship is also created/fetched from the transaction:

+
let jane: MyPersonEntity = // ...
+let john: MyPersonEntity = // ...
+
+CoreStore.perform(
+    asynchronous: { (transaction) -> Void in
+        // WRONG: jane.friends = [john]
+        // RIGHT:
+        let jane = transaction.edit(jane)!
+        let john = transaction.edit(john)!
+        jane.friends = NSSet(array: [john])
+    },
+    completion: { _ in }
+)
+
+

Deleting objects

+ +

Deleting an object is simpler because you can tell a transaction to delete an object directly without fetching an editable proxy (CoreStore does that for you):

+
let john: MyPersonEntity = // ...
+
+CoreStore.perform(
+    asynchronous: { (transaction) -> Void in
+        transaction.delete(john)
+    },
+    completion: { _ in }
+)
+
+ +

or several objects at once:

+
let john: MyPersonEntity = // ...
+let jane: MyPersonEntity = // ...
+
+CoreStore.perform(
+    asynchronous: { (transaction) -> Void in
+        transaction.delete(john, jane)
+        // transaction.delete([john, jane]) is also allowed
+    },
+    completion: { _ in }
+)
+
+ +

If you do not have references yet to the objects to be deleted, transactions have a deleteAll(...) method you can pass a query to:

+
CoreStore.perform(
+    asynchronous: { (transaction) -> Void in
+        transaction.deleteAll(
+            From<MyPersonEntity>()
+                .where(\.age > 30)
+        )
+    },
+    completion: { _ in }
+)
+
+

Passing objects safely

+ +

Always remember that the DataStack and individual transactions manage different NSManagedObjectContexts so you cannot just use objects between them. That’s why transactions have an edit(...) method:

+
let jane: MyPersonEntity = // ...
+
+CoreStore.perform(
+    asynchronous: { (transaction) -> Void in
+        let jane = transaction.edit(jane)!
+        jane.age = jane.age + 1
+    },
+    completion: { _ in }
+)
+
+ +

But CoreStore, DataStack and BaseDataTransaction have a very flexible fetchExisting(...) method that you can pass instances back and forth with:

+
let jane: MyPersonEntity = // ...
+
+CoreStore.perform(
+    asynchronous: { (transaction) -> MyPersonEntity in
+        let jane = transaction.fetchExisting(jane)! // instance for transaction
+        jane.age = jane.age + 1
+        return jane
+    },
+    success: { (transactionJane) in
+        let jane = CoreStore.fetchExisting(transactionJane)! // instance for DataStack
+        print(jane.age)
+    },
+    failure: { (error) in
+        // ...
+    }
+)
+
+ +

fetchExisting(...) also works with multiple NSManagedObjects, CoreStoreObjects, or with NSManagedObjectIDs:

+
var peopleIDs: [NSManagedObjectID] = // ...
+
+CoreStore.perform(
+    asynchronous: { (transaction) -> Void in
+        let jane = transaction.fetchOne(
+            From<MyPersonEntity>()
+                .where(\.name == "Jane Smith")
+        )
+        jane.friends = NSSet(array: transaction.fetchExisting(peopleIDs)!)
+        // ...
+    },
+    completion: { _ in }
+)
+
+

Importing data

+ +

Some times, if not most of the time, the data that we save to Core Data comes from external sources such as web servers or external files. If you have for example a JSON dictionary, you may be extracting values as such:

+
let json: [String: Any] = // ...
+person.name = json["name"] as? NSString
+person.age = json["age"] as? NSNumber
+// ...
+
+ +

If you have many attributes, you don’t want to keep repeating this mapping everytime you want to import data. CoreStore lets you write the data mapping code just once, and all you have to do is call importObject(...) or importUniqueObject(...) through BaseDataTransaction subclasses:

+
CoreStore.perform(
+    asynchronous: { (transaction) -> Void in
+        let json: [String: Any] = // ...
+        try! transaction.importObject(
+            Into<MyPersonEntity>(),
+            source: json
+        )
+    },
+    completion: { _ in }
+)
+
+ +

To support data import for an entity, implement either ImportableObject or ImportableUniqueObject on the NSManagedObject or CoreStoreObject subclass:

+ +
    +
  • ImportableObject: Use this protocol if the object have no inherent uniqueness and new objects should always be added when calling importObject(...).
  • +
  • ImportableUniqueObject: Use this protocol to specify a unique ID for an object that will be used to distinguish whether a new object should be created or if an existing object should be updated when calling importUniqueObject(...).
  • +
+ +

Both protocols require implementers to specify an ImportSource which can be set to any type that the object can extract data from:

+
typealias ImportSource = NSDictionary
+
+
typealias ImportSource = [String: Any]
+
+
typealias ImportSource = NSData
+
+ +

You can even use external types from popular 3rd-party JSON libraries, or just simple tuples or primitives.

+

ImportableObject

+ +

ImportableObject is a very simple protocol:

+
public protocol ImportableObject: class {
+    typealias ImportSource
+    static func shouldInsert(from source: ImportSource, in transaction: BaseDataTransaction) -> Bool
+    func didInsert(from source: ImportSource, in transaction: BaseDataTransaction) throws
+}
+
+ +

First, set ImportSource to the expected type of the data source:

+
typealias ImportSource = [String: Any]
+
+ +

This lets us call importObject(_:source:) with any [String: Any] type as the argument to source:

+
CoreStore.perform(
+    asynchronous: { (transaction) -> Void in
+        let json: [String: Any] = // ...
+        try! transaction.importObject(
+            Into<MyPersonEntity>(),
+            source: json
+        )
+        // ...
+    },
+    completion: { _ in }
+)
+
+ +

The actual extraction and assignment of values should be implemented in the didInsert(from:in:) method of the ImportableObject protocol:

+
func didInsert(from source: ImportSource, in transaction: BaseDataTransaction) throws {
+    self.name = source["name"] as? NSString
+    self.age = source["age"] as? NSNumber
+    // ...
+}
+
+ +

Transactions also let you import multiple objects at once using the importObjects(_:sourceArray:) method:

+
CoreStore.perform(
+    asynchronous: { (transaction) -> Void in
+        let jsonArray: [[String: Any]] = // ...
+        try! transaction.importObjects(
+            Into<MyPersonEntity>(),
+            sourceArray: jsonArray // make sure this is of type Array<MyPersonEntity.ImportSource>
+        )
+        // ...
+    },
+    completion: { _ in }
+)
+
+ +

Doing so tells the transaction to iterate through the array of import sources and calls shouldInsert(from:in:) on the ImportableObject to determine which instances should be created. You can do validations and return false from shouldInsert(from:in:) if you want to skip importing from a source and continue on with the other sources in the array.

+ +

If on the other hand, your validation in one of the sources failed in such a manner that all other sources should also be rolled back and cancelled, you can throw from within didInsert(from:in:):

+
func didInsert(from source: ImportSource, in transaction: BaseDataTransaction) throws {
+    self.name = source["name"] as? NSString
+    self.age = source["age"] as? NSNumber
+    // ...
+    if self.name == nil {
+        throw Errors.InvalidNameError
+    }
+}
+
+ +

Doing so can let you abandon an invalid transaction immediately:

+
CoreStore.perform(
+    asynchronous: { (transaction) -> Void in
+        let jsonArray: [[String: Any]] = // ...
+
+        try transaction.importObjects(
+            Into<MyPersonEntity>(),
+            sourceArray: jsonArray
+        )
+    },
+    success: {
+        // ...
+    },
+    failure: { (error) in
+        switch error {
+        case Errors.InvalidNameError: print("Invalid name")
+        // ...
+        }
+    }
+)
+
+

ImportableUniqueObject

+ +

Typically, we don’t just keep creating objects every time we import data. Usually we also need to update already existing objects. Implementing the ImportableUniqueObject protocol lets you specify a unique ID that transactions can use to search existing objects before creating new ones:

+
public protocol ImportableUniqueObject: ImportableObject {
+    typealias ImportSource
+    typealias UniqueIDType: ImportableAttributeType
+
+    static var uniqueIDKeyPath: String { get }
+    var uniqueIDValue: UniqueIDType { get set }
+
+    static func shouldInsert(from source: ImportSource, in transaction: BaseDataTransaction) -> Bool
+    static func shouldUpdate(from source: ImportSource, in transaction: BaseDataTransaction) -> Bool
+    static func uniqueID(from source: ImportSource, in transaction: BaseDataTransaction) throws -> UniqueIDType?
+    func didInsert(from source: ImportSource, in transaction: BaseDataTransaction) throws
+    func update(from source: ImportSource, in transaction: BaseDataTransaction) throws
+}
+
+ +

Notice that it has the same insert methods as ImportableObject, with additional methods for updates and for specifying the unique ID:

+
class var uniqueIDKeyPath: String {
+    return #keyPath(MyPersonEntity.personID) 
+}
+var uniqueIDValue: Int { 
+    get { return self.personID }
+    set { self.personID = newValue }
+}
+class func uniqueID(from source: ImportSource, in transaction: BaseDataTransaction) throws -> Int? {
+    return source["id"] as? Int
+}
+
+ +

For ImportableUniqueObject, the extraction and assignment of values should be implemented from the update(from:in:) method. The didInsert(from:in:) by default calls update(from:in:), but you can separate the implementation for inserts and updates if needed.

+ +

You can then create/update an object by calling a transaction’s importUniqueObject(...) method:

+
CoreStore.perform(
+    asynchronous: { (transaction) -> Void in
+        let json: [String: Any] = // ...
+        try! transaction.importUniqueObject(
+            Into<MyPersonEntity>(),
+            source: json
+        )
+        // ...
+    },
+    completion: { _ in }
+)
+
+ +

or multiple objects at once with the importUniqueObjects(...) method:

+
CoreStore.perform(
+    asynchronous: { (transaction) -> Void in
+        let jsonArray: [[String: AnyObject]] = // ...
+        try! transaction.importUniqueObjects(
+            Into<MyPersonEntity>(),
+            sourceArray: jsonArray
+        )
+        // ...
+    },
+    completion: { _ in }
+)
+
+ +

As with ImportableObject, you can control wether to skip importing an object by implementing +shouldInsert(from:in:) and shouldUpdate(from:in:), or to cancel all objects by throwing an error from the uniqueID(from:in:), didInsert(from:in:) or update(from:in:) methods.

+

Fetching and Querying

+ +

Before we dive in, be aware that CoreStore distinguishes between fetching and querying:

+ +
    +
  • A fetch executes searches from a specific transaction or data stack. This means fetches can include pending objects (i.e. before a transaction calls on commit().) Use fetches when: + +
      +
    • results need to be NSManagedObject or CoreStoreObject instances
    • +
    • unsaved objects should be included in the search (though fetches can be configured to exclude unsaved ones)
    • +
  • +
  • A query pulls data straight from the persistent store. This means faster searches when computing aggregates such as count, min, max, etc. Use queries when: + +
      +
    • you need to compute aggregate functions (see below for a list of supported functions)
    • +
    • results can be raw values like NSStrings, NSNumbers, Ints, NSDates, an NSDictionary of key-values, or any type that conform to QueryableAttributeType. (See QueryableAttributeType.swift for a list of built-in types)
    • +
    • only values for specified attribute keys need to be included in the results
    • +
    • unsaved objects should be ignored
    • +
  • +
+

From clause

+ +

The search conditions for fetches and queries are specified using clauses. All fetches and queries require a From clause that indicates the target entity type:

+
let people = CoreStore.fetchAll(From<MyPersonEntity>())
+
+ +

people in the example above will be of type [MyPersonEntity]. The From<MyPersonEntity>() clause indicates a fetch to all persistent stores that MyPersonEntity belong to.

+ +

If the entity exists in multiple configurations and you need to only search from a particular configuration, indicate in the From clause the configuration name for the destination persistent store:

+
let people = CoreStore.fetchAll(From<MyPersonEntity>("Config1")) // ignore objects in persistent stores other than the "Config1" configuration
+
+ +

or if the persistent store is the auto-generated Default configuration, specify nil:

+
let person = CoreStore.fetchAll(From<MyPersonEntity>(nil))
+
+ +

Now we know how to use a From clause, let’s move on to fetching and querying.

+

Fetching

+ +

There are currently 5 fetch methods you can call from CoreStore, from a DataStack instance, or from a BaseDataTransaction instance. All of the methods below accept the same parameters: a required From clause, and an optional series of Where, OrderBy, and/or Tweak clauses.

+ +
    +
  • fetchAll(...) - returns an array of all objects that match the criteria.
  • +
  • fetchOne(...) - returns the first object that match the criteria.
  • +
  • fetchCount(...) - returns the number of objects that match the criteria.
  • +
  • fetchObjectIDs(...) - returns an array of NSManagedObjectIDs for all objects that match the criteria.
  • +
  • fetchObjectID(...) - returns the NSManagedObjectIDs for the first objects that match the criteria.
  • +
+ +

Each method’s purpose is straightforward, but we need to understand how to set the clauses for the fetch.

+

Where clause

+ +

The Where clause is CoreStore’s NSPredicate wrapper. It specifies the search filter to use when fetching (or querying). It implements all initializers that NSPredicate does (except for -predicateWithBlock:, which Core Data does not support):

+
var people = CoreStore.fetchAll(
+    From<MyPersonEntity>(),
+    Where<MyPersonEntity>("%K > %d", "age", 30) // string format initializer
+)
+people = CoreStore.fetchAll(
+    From<MyPersonEntity>(),
+    Where<MyPersonEntity>(true) // boolean initializer
+)
+
+ +

If you do have an existing NSPredicate instance already, you can pass that to Where as well:

+
let predicate = NSPredicate(...)
+var people = CoreStore.fetchAll(
+    From<MyPersonEntity>(),
+    Where<MyPersonEntity>(predicate) // predicate initializer
+)
+
+ +

⭐️Starting CoreStore 5.0, Where clauses became more type-safe and are now generic types. To avoid verbose repetition of the generic object type, fetch methods now support Fetch Chain builders. We can also use Swift’s Smart KeyPaths as the Where clause expression:

+
var people = CoreStore.fetchAll(
+    From<MyPersonEntity>()
+        .where(\.age > 30) // Type-safe!
+)
+
+ +

Where clauses also implement the &&, ||, and ! logic operators, so you can provide logical conditions without writing too much AND, OR, and NOT strings:

+
var people = CoreStore.fetchAll(
+    From<MyPersonEntity>()
+        .where(\.age > 30 && \.gender == "M")
+)
+
+ +

If you do not provide a Where clause, all objects that belong to the specified From will be returned.

+

OrderBy clause

+ +

The OrderBy clause is CoreStore’s NSSortDescriptor wrapper. Use it to specify attribute keys in which to sort the fetch (or query) results with.

+
var mostValuablePeople = CoreStore.fetchAll(
+    From<MyPersonEntity>(),
+    OrderBy<MyPersonEntity>(.descending("rating"), .ascending("surname"))
+)
+
+ +

As seen above, OrderBy accepts a list of SortKey enumeration values, which can be either .ascending or .descending. +⭐️As with Where clauses, CoreStore 5.0 turned OrderBy clauses into generic types. To avoid verbose repetition of the generic object type, fetch methods now support Fetch Chain builders. We can also use Swift’s Smart KeyPaths as the OrderBy clause expression:

+
var people = CoreStore.fetchAll(
+    From<MyPersonEntity>()
+        .orderBy(.descending(\.rating), .ascending(\.surname)) // Type-safe!
+)
+
+ +

You can use the + and += operator to append OrderBys together. This is useful when sorting conditionally:

+
var orderBy = OrderBy<MyPersonEntity>(.descending(\.rating))
+if sortFromYoungest {
+    orderBy += OrderBy(.ascending(\.age))
+}
+var mostValuablePeople = CoreStore.fetchAll(
+    From<MyPersonEntity>(),
+    orderBy
+)
+
+

Tweak clause

+ +

The Tweak clause lets you, uh, tweak the fetch (or query). Tweak exposes the NSFetchRequest in a closure where you can make changes to its properties:

+
var people = CoreStore.fetchAll(
+    From<MyPersonEntity>(),
+    Where<MyPersonEntity>("age > %d", 30),
+    OrderBy<MyPersonEntity>(.ascending("surname")),
+    Tweak { (fetchRequest) -> Void in
+        fetchRequest.includesPendingChanges = false
+        fetchRequest.returnsObjectsAsFaults = false
+        fetchRequest.includesSubentities = false
+    }
+)
+
+ +

Tweak also supports Fetch Chain builders:

+
var people = CoreStore.fetchAll(
+    From<MyPersonEntity>(),
+        .where(\.age > 30)
+        .orderBy(.ascending(\.surname))
+        .tweak {
+            $0.includesPendingChanges = false
+            $0.returnsObjectsAsFaults = false
+            $0.includesSubentities = false
+        }
+)
+
+ +

The clauses are evaluated the order they appear in the fetch/query, so you typically need to set Tweak as the last clause. +Tweak‘s closure is executed only just before the fetch occurs, so make sure that any values captured by the closure is not prone to race conditions.

+ +

While Tweak lets you micro-configure the NSFetchRequest, note that CoreStore already preconfigured that NSFetchRequest to suitable defaults. Only use Tweak when you know what you are doing!

+

Querying

+ +

One of the functionalities overlooked by other Core Data wrapper libraries is raw properties fetching. If you are familiar with NSDictionaryResultType and -[NSFetchedRequest propertiesToFetch], you probably know how painful it is to setup a query for raw values and aggregate values. CoreStore makes this easy by exposing the 2 methods below:

+ +
    +
  • queryValue(...) - returns a single raw value for an attribute or for an aggregate value. If there are multiple results, queryValue(...) only returns the first item.
  • +
  • queryAttributes(...) - returns an array of dictionaries containing attribute keys with their corresponding values.
  • +
+ +

Both methods above accept the same parameters: a required From clause, a required Select<T> clause, and an optional series of Where, OrderBy, GroupBy, and/or Tweak clauses.

+ +

Setting up the From, Where, OrderBy, and Tweak clauses is similar to how you would when fetching. For querying, you also need to know how to use the Select<T> and GroupBy clauses.

+

Select<T> clause

+ +

The Select<T> clause specifies the target attribute/aggregate key, as well as the expected return type:

+
let johnsAge = CoreStore.queryValue(
+    From<MyPersonEntity>(),
+    Select<Int>("age"),
+    Where("name == %@", "John Smith")
+)
+
+ +

The example above queries the age property for the first object that matches the Where condition. johnsAge will be bound to type Int?, as indicated by the Select<Int> generic type. For queryValue(...), types that conform to QueryableAttributeType are allowed as the return type (and therefore as the generic type for Select<T>).

+ +

For queryAttributes(...), only NSDictionary is valid for Select, thus you are allowed to omit the generic type:

+
let allAges = CoreStore.queryAttributes(
+    From<MyPersonEntity>(),
+    Select("age")
+)
+
+ +

⭐️Starting CoreStore 5.0, query methods now support Query Chain builders. We can also use Swift’s Smart KeyPaths to use in the expressions:

+
let johnsAge = CoreStore.queryValue(
+    From<MyPersonEntity>()
+        .select(\.age) // binds the result to Int
+        .where(\.name == "John Smith")
+)
+
+ +

If you only need a value for a particular attribute, you can just specify the key name (like we did with Select<Int>("age")), but several aggregate functions can also be used as parameter to Select:

+ +
    +
  • .average(...)
  • +
  • .count(...)
  • +
  • .maximum(...)
  • +
  • .minimum(...)
  • +
  • .sum(...)
  • +
+
let oldestAge = CoreStore.queryValue(
+    From<MyPersonEntity>(),
+    Select<Int>(.maximum("age"))
+)
+
+ +

For queryAttributes(...) which returns an array of dictionaries, you can specify multiple attributes/aggregates to Select:

+
let personJSON = CoreStore.queryAttributes(
+    From<MyPersonEntity>(),
+    Select("name", "age")
+)
+
+ +

personJSON will then have the value:

+
[
+    [
+        "name": "John Smith",
+        "age": 30
+    ],
+    [
+        "name": "Jane Doe",
+        "age": 22
+    ]
+]
+
+ +

You can also include an aggregate as well:

+
let personJSON = CoreStore.queryAttributes(
+    From<MyPersonEntity>(),
+    Select("name", .count("friends"))
+)
+
+ +

which returns:

+
[
+    [
+        "name": "John Smith",
+        "count(friends)": 42
+    ],
+    [
+        "name": "Jane Doe",
+        "count(friends)": 231
+    ]
+]
+
+ +

The "count(friends)" key name was automatically used by CoreStore, but you can specify your own key alias if you need:

+
let personJSON = CoreStore.queryAttributes(
+    From<MyPersonEntity>(),
+    Select("name", .count("friends", as: "friendsCount"))
+)
+
+ +

which now returns:

+
[
+    [
+        "name": "John Smith",
+        "friendsCount": 42
+    ],
+    [
+        "name": "Jane Doe",
+        "friendsCount": 231
+    ]
+]
+
+

GroupBy clause

+ +

The GroupBy clause lets you group results by a specified attribute/aggregate. This is useful only for queryAttributes(...) since queryValue(...) just returns the first value.

+
let personJSON = CoreStore.queryAttributes(
+    From<MyPersonEntity>(),
+    Select("age", .count("age", as: "count")),
+    GroupBy("age")
+)
+
+ +

⭐️Starting CoreStore 5.0, GroupBy clauses are now also generic types and now support Query Chain builders. We can also use Swift’s Smart KeyPaths to use in the expressions:

+
let personJSON = CoreStore.queryAttributes(
+    From<MyPersonEntity>()
+        .select(.attribute(\.age), .count(\.age, as: "count"))
+        .groupBy(\.age)
+)
+
+ +

this returns dictionaries that shows the count for each "age":

+
[
+    [
+        "age": 42,
+        "count": 1
+    ],
+    [
+        "age": 22,
+        "count": 1
+    ]
+]
+
+

Logging and error reporting

+ +

One unfortunate thing when using some third-party libraries is that they usually pollute the console with their own logging mechanisms. CoreStore provides its own default logging class, but you can plug-in your own favorite logger by implementing the CoreStoreLogger protocol.

+
public protocol CoreStoreLogger {
+    func log(level level: LogLevel, message: String, fileName: StaticString, lineNumber: Int, functionName: StaticString)
+    func log(error error: CoreStoreError, message: String, fileName: StaticString, lineNumber: Int, functionName: StaticString)
+    func assert(@autoclosure condition: () -> Bool, @autoclosure message: () -> String, fileName: StaticString, lineNumber: Int, functionName: StaticString)
+    func abort(message: String, fileName: StaticString, lineNumber: Int, functionName: StaticString)
+}
+
+ +

Implement this protocol with your custom class then pass the instance to CoreStore.logger:

+
CoreStore.logger = MyLogger()
+
+ +

Doing so channels all logging calls to your logger.

+ +

Note that to keep the call stack information intact, all calls to these methods are NOT thread-managed. Therefore you have to make sure that your logger is thread-safe or you may otherwise have to dispatch your logging implementation to a serial queue.

+ +

Take special care when implementing CoreStoreLogger’s assert(...) and abort(...) functions:

+ +
    +
  • assert(...): The behavior between DEBUG and release builds, or -O and -Onone, are all left to the implementers’ responsibility. CoreStore calls CoreStoreLogger.assert(...) only for invalid but usually recoverable errors (for example, early validation failures that may cause an error thrown and handled somewhere else)
  • +
  • abort(...): This method is the last-chance for your app to synchronously log a fatal error within CoreStore. The app will be terminated right after this function is called (CoreStore calls fatalError() internally)
  • +
+ +

Starting CoreStore 2.0, all CoreStore types now have very useful (and pretty formatted!) print(...) outputs.

+ +

A couple of examples, ListMonitor:

+ +

screen shot 2016-07-10 at 22 56 44

+ +

CoreStoreError.mappingModelNotFoundError:

+ +

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 versions below 10.12)

+
+ +

CoreStore provides type-safe wrappers for observing managed objects:

+ + +

Observe a single object

+ +

To observe an object, implement the ObjectObserver protocol and specify the EntityType:

+
class MyViewController: UIViewController, ObjectObserver {
+    func objectMonitor(monitor: ObjectMonitor<MyPersonEntity>, willUpdateObject object: MyPersonEntity) {
+        // ...
+    }
+
+    func objectMonitor(monitor: ObjectMonitor<MyPersonEntity>, didUpdateObject object: MyPersonEntity, changedPersistentKeys: Set<KeyPathString>) {
+        // ...
+    }
+
+    func objectMonitor(monitor: ObjectMonitor<MyPersonEntity>, didDeleteObject object: MyPersonEntity) {
+        // ...
+    }
+}
+
+ +

We then need to keep a ObjectMonitor instance and register our ObjectObserver as an observer:

+
let person: MyPersonEntity = // ...
+self.monitor = CoreStore.monitorObject(person)
+self.monitor.addObserver(self)
+
+ +

The controller will then notify our observer whenever the object’s attributes change. You can add multiple ObjectObservers to a single ObjectMonitor without any problem. This means you can just share around the ObjectMonitor instance to different screens without problem.

+ +

You can get ObjectMonitor‘s object through its object property. If the object is deleted, the object property will become nil to prevent further access.

+ +

While ObjectMonitor exposes removeObserver(...) as well, it only stores weak references of the observers and will safely unregister deallocated observers.

+

Observe a list of objects

+ +

To observe a list of objects, implement one of the ListObserver protocols and specify the EntityType:

+
class MyViewController: UIViewController, ListObserver {
+    func listMonitorDidChange(monitor: ListMonitor<MyPersonEntity>) {
+        // ...
+    }
+
+    func listMonitorDidRefetch(monitor: ListMonitor<MyPersonEntity>) {
+        // ...
+    }
+}
+
+ +

Including ListObserver, there are 3 observer protocols you can implement depending on how detailed you need to handle a change notification:

+ +
    +
  • ListObserver: lets you handle these callback methods:

    +
    func listMonitorWillChange(_ monitor: ListMonitor<MyPersonEntity>)
    +func listMonitorDidChange(_ monitor: ListMonitor<MyPersonEntity>)
    +func listMonitorWillRefetch(_ monitor: ListMonitor<MyPersonEntity>)
    +func listMonitorDidRefetch(_ monitor: ListMonitor<MyPersonEntity>)
    +
    + +

    listMonitorDidChange(_:) and listMonitorDidRefetch(_:) implementations are both required. listMonitorDidChange(_:) is called whenever the ListMonitor’s count, order, or filtered objects change. listMonitorDidRefetch(_:) is called when the ListMonitor.refetch() was executed or if the internal persistent store was changed.

  • +
  • ListObjectObserver: in addition to ListObserver methods, also lets you handle object inserts, updates, and deletes:

    +
    func listMonitor(_ monitor: ListMonitor<MyPersonEntity>, didInsertObject object: MyPersonEntity, toIndexPath indexPath: NSIndexPath)
    +func listMonitor(_ monitor: ListMonitor<MyPersonEntity>, didDeleteObject object: MyPersonEntity, fromIndexPath indexPath: NSIndexPath)
    +func listMonitor(_ monitor: ListMonitor<MyPersonEntity>, didUpdateObject object: MyPersonEntity, atIndexPath indexPath: NSIndexPath)
    +func listMonitor(_ monitor: ListMonitor<MyPersonEntity>, didMoveObject object: MyPersonEntity, fromIndexPath: NSIndexPath, toIndexPath: NSIndexPath)
    +
  • +
  • ListSectionObserver: in addition to ListObjectObserver methods, also lets you handle section inserts and deletes:

    +
    func listMonitor(_ monitor: ListMonitor<MyPersonEntity>, didInsertSection sectionInfo: NSFetchedResultsSectionInfo, toSectionIndex sectionIndex: Int)
    +func listMonitor(_ monitor: ListMonitor<MyPersonEntity>, didDeleteSection sectionInfo: NSFetchedResultsSectionInfo, fromSectionIndex sectionIndex: Int)
    +
  • +
+ +

We then need to create a ListMonitor instance and register our ListObserver as an observer:

+
self.monitor = CoreStore.monitorList(
+    From<MyPersonEntity>()
+        .where(\.age > 30)
+        .orderBy(.ascending(\.name))
+        .tweak { $0.fetchBatchSize = 20 }
+)
+self.monitor.addObserver(self)
+
+ +

Similar to ObjectMonitor, a ListMonitor can also have multiple ListObservers registered to a single ListMonitor.

+ +

If you have noticed, the monitorList(...) method accepts Where, OrderBy, and Tweak clauses exactly like a fetch. As the list maintained by ListMonitor needs to have a deterministic order, at least the From and OrderBy clauses are required.

+ +

A ListMonitor created from monitorList(...) will maintain a single-section list. You can therefore access its contents with just an index:

+
let firstPerson = self.monitor[0]
+
+ +

If the list needs to be grouped into sections, create the ListMonitor instance with the monitorSectionedList(...) method and a SectionBy clause:

+
self.monitor = CoreStore.monitorSectionedList(
+    From<MyPersonEntity>()
+        .sectionBy(\.age)
+        .where(\.gender == "M")
+        .orderBy(.ascending(\.age), .ascending(\.name))
+        .tweak { $0.fetchBatchSize = 20 }
+)
+
+ +

A list controller created this way will group the objects by the attribute key indicated by the SectionBy clause. One more thing to remember is that the OrderBy clause should sort the list in such a way that the SectionBy attribute would be sorted together (a requirement shared by NSFetchedResultsController.)

+ +

The SectionBy clause can also be passed a closure to transform the section name into a displayable string:

+
self.monitor = CoreStore.monitorSectionedList(
+    From<MyPersonEntity>()
+        .sectionBy(\.age) { (sectionName) -> String? in
+            "\(sectionName) years old"
+        }
+        .orderBy(.ascending(\.age), .ascending(\.name))
+)
+
+ +

This is useful when implementing a UITableViewDelegate’s section header:

+
func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
+    let sectionInfo = self.monitor.sectionInfoAtIndex(section)
+    return sectionInfo.name
+}
+
+ +

To access the objects of a sectioned list, use an NSIndexPath or a tuple:

+
let indexPath = NSIndexPath(forRow: 2, inSection: 1)
+let person1 = self.monitor[indexPath]
+let person2 = self.monitor[1, 2]
+// person1 and person2 are the same object
+
+

Objective-C support

+ +
+

⚠️Objective-C support is planned to be deprecated in a future CoreStore version.

+
+ +

All CoreStore types are still written in pure Swift, but most core types have Objective-C bridging classes that are visible to Objective-C code. To show a couple of usage examples:

+ + + + + + + + + + + +
SwiftObjective-C
+try CoreStore.addStorageAndWait(SQLiteStore.self)
+
+NSError *error
+[CSCoreStore addSQLiteStorageAndWait:[CSSQLiteStore new] error:&error]
+
+CoreStore.perform(
+    asynchronous: { (transaction) in
+        // ...
+    },
+    completion: { (result) in
+        switch result {
+        case .success: print("Done")
+        case .failure(let error): print(error)
+        }
+    }
+)
+
+[CSCoreStore beginAsynchronous:^(CSAsynchronousDataTransaction *transaction) {
+    // ...
+    [transaction commitWithCompletion:^(CSSaveResult *result) {
+        if (result.isSuccess) {
+            NSLog(@"Done");
+        }
+        else if (result.isFailure) {
+            NSLog(@"error: %@", result.error);
+        }
+    }];
+}];
+
+ +

All of these CS-prefixed bridging classes have very similar usage to the existing CoreStore APIs, and ironically none of them are written in Objective-C. This is very different to the common approach where apps and libraries write Objective-C APIs just to support both Objective-C and Swift. The advantage with CoreStore’s approach is that your Swift codebase can already use the purely-Swift API without further changes in the future, but your hybrid codebase can still bridge instances back and forth from Objective-C to Swift.

+ +

For example, you may have a new, modern Swift class that holds a ListMonitor:

+
class MyViewController: UIViewController {
+    let monitor = CoreStore.monitorList(From<MyEntity>(), ...)
+    // ...
+}
+
+ +

Now let’s say you have a legacy Objective-C class that previously uses NSFetchedResultsController. It’s easy to switch from NSFetchedResultsController to CSListMonitor, but converting the rest of this huge class is impractical. You end up with

+
@interface MYOldViewController: UIViewController 
+@property (nonatomic, readonly, strong) CSListMonitor* monitor;
+- (instancetype)initWithMonitor:(CSListMonitor *)monitor;
+@end
+
+ +

When you need to instantiate this class from Swift, you just call bridgeToObjectiveC:

+
class MyViewController: UIViewController {
+    let monitor = CoreStore.monitorList(From<MyEntity>(), ...)
+    func showOldController() {
+        let controller = MYOldViewController(monitor: self.monitor.bridgeToObjectiveC)
+        self.presentViewController(controller, animated: true, completion: nil)
+    }
+}
+
+ +

Note that the CSListMonitor holds the exact same ListMonitor instance, which means that no copies and no extra fetching occur.

+

Objective-C syntax sugars

+ +

Objective-C tends to be verbose, so some method calls are long and unreadable. For example, fetching looks like this:

+
NSArray<MYPerson *> *objects = 
+[CSCoreStore
+ fetchAllFrom:[[CSFrom alloc] initWithEntityClass:[MYPerson class]]
+ fetchClauses:@[[[CSWhere alloc] initWithFormat:@"%K == %@", @"isHidden", @NO],
+                [[CSOrderBy alloc] initWithSortDescriptors:@[[NSSortDescriptor sortDescriptorWithKey:@"lastName" ascending:YES],
+                                                             [NSSortDescriptor sortDescriptorWithKey:@"firstName" ascending:YES]]]]];
+
+ +

Although it works, it looks terrible. For this, CoreStore provides CoreStoreBridge.h where these Objective-C calls are wrapped in readable, convenient macros and global functions. The call above becomes

+
NSArray<MYPerson *> *objects = 
+[CSCoreStore
+ fetchAllFrom:CSFromClass([MYPerson class])
+ fetchClauses:@[CSWhereFormat(@"%K == %@", @"isHidden", @NO),
+                CSOrderByKeys(CSSortAscending(@"lastName"),
+                              CSSortAscending(@"firstName"), nil)]];
+
+ +

That’s much shorter now. But we can still do better. Notice that we have strings being used as key paths. The CSKeyPath(...) macro gives us compile-time checking so keys that don’t exist in a class will generate errors. Our key-safe code now looks like this:

+
NSArray<MYPerson *> *objects = 
+[CSCoreStore
+ fetchAllFrom:CSFromClass([MYPerson class])
+ fetchClauses:@[CSWhereFormat(@"%K == %@", CSKeyPath(MYPerson, isHidden), @NO),
+                CSOrderByKeys(CSSortAscending(CSKeyPath(MYPerson, lastName)),
+                              CSSortAscending(CSKeyPath(MYPerson, firstName)), nil)]];
+
+ +

To use these syntax sugars, include CoreStoreBridge.h in your Objective-C source files.

+

Type-safe CoreStoreObjects

+ +

Starting CoreStore 4.0, we can now create persisted objects without depending on .xcdatamodeld Core Data files. The new CoreStoreObject subclass replaces NSManagedObject, and specially-typed properties declared on these classes will be synthesized as Core Data attributes.

+
class Animal: CoreStoreObject {
+    let species = Value.Required<String>("species", initial: "")
+}
+
+class Dog: Animal {
+    let nickname = Value.Optional<String>("nickname")
+    let master = Relationship.ToOne<Person>("master")
+}
+
+class Person: CoreStoreObject {
+    let name = Value.Required<String>("name", initial: "")
+    let pets = Relationship.ToManyUnordered<Dog>("pets", inverse: { $0.master })
+}
+
+ +

The property names to be saved to Core Data is specified as the keyPath argument. This lets us refactor our Swift code without affecting the underlying database. For example:

+
class Person: CoreStoreObject {
+    private let _name = Value.Required<String>("name", initial: "")
+    // note property name is independent of the storage key name
+}
+
+ +

Here we added an underscore to the property name and made it private, but the underlying key-path "name" was unchanged so our model will not trigger a data migration.

+ +
+

⚠️Important: As a rule, CoreStore can only process stored properties. Computed, static, weak, or lazy properties will be ignored and will not be added to the store. It is also strictly advised use let instead of var to declare these properties, as any changes to the property value will break the schema.

+
+ +

Also note how Relationships are linked statically with the inverse: argument. All relationships are required to have an inverse relationship. Unfortunately, due to Swift compiler limitation we can only declare the inverse: on one end of the relationship-pair.

+ +

To tell the DataStack about these types, add all CoreStoreObjects’ entities to a CoreStoreSchema:

+

+CoreStore.defaultStack = DataStack(
+    CoreStoreSchema(
+        modelVersion: "V1",
+        entities: [
+            Entity<Animal>("Animal", isAbstract: true),
+            Entity<Dog>("Dog"),
+            Entity<Person>("Person")
+        ]
+    )
+)
+CoreStore.addStorage(/* ... */)
+
+ +

And that’s all CoreStore needs to build the model; we don’t need .xcdatamodeld files anymore.

+ +

These special properties’ values can be accessed or mutated using .value:

+
CoreStore.perform(
+    asynchronous: { (transaction) in
+        let dog: Dog = transaction.fetchOne(From<Dog>())!
+        // ...
+        let nickname = dog.nickname.value // String?
+        let species = dog.species.value // String
+        let age = dog.age.value // Int
+        // ...
+        dog.age.value = age + 1
+    },
+    completion: { /* ... */ }
+)
+
+ +

In addition, Value and Relationship properties can be used to create type-safe key-paths

+
let keyPath: String = Dog.keyPath { $0.nickname }
+
+ +

as well as Where and OrderBy clauses

+
let puppies = CoreStore.fetchAll(
+    From<Dog>()
+        .where(\.age < 1)
+        .orderBy(.ascending(\.age))
+)
+
+ +

All CoreStore APIs that are usable with NSManagedObjects are also available for CoreStoreObjects. These include ListMonitors, ImportableObjects, fetching, etc.

+

VersionLocks

+ +

While it is convenient to be able to declare entities only in code, it is worrying that we might accidentally change the CoreStoreObject‘s properties and break our users’ model version history. For this, the CoreStoreSchema allows us to lock our properties to a particular configuration. Any changes to that VersionLock will raise an assertion failure during the CoreStoreSchema initialization, so you can then look for the commit which changed the VersionLock hash.

+ +

To use VersionLocks, create the CoreStoreSchema, run the app, and look for a similar log message that is automatically printed to the console:

+ +

VersionLock

+ +

Copy this dictionary value and use it as the versionLock: argument of the CoreStoreSchema initializer:

+
CoreStoreSchema(
+    modelVersion: "V1",
+    entities: [
+        Entity<Animal>("Animal", isAbstract: true),
+        Entity<Dog>("Dog"),
+        Entity<Person>("Person"),
+    ],
+    versionLock: [
+        "Animal": [0x1b59d511019695cf, 0xdeb97e86c5eff179, 0x1cfd80745646cb3, 0x4ff99416175b5b9a],
+        "Dog": [0xe3f0afeb109b283a, 0x29998d292938eb61, 0x6aab788333cfc2a3, 0x492ff1d295910ea7],
+        "Person": [0x66d8bbfd8b21561f, 0xcecec69ecae3570f, 0xc4b73d71256214ef, 0x89b99bfe3e013e8b]
+    ]
+)
+
+ +

You can also get this hash after the DataStack has been fully set up by printing to the console:

+
print(CoreStore.defaultStack.modelSchema.printCoreStoreSchema())
+
+ +

Once the version lock is set, any changes in the properties or to the model will trigger an assertion failure similar to this:

+ +

VersionLock failure

+

Installation

+
+

Requires

+
    +
  • iOS 8 SDK and above
  • +
  • Swift 4 (Xcode 9+)
  • +
+ +
+
  • Dependencies: + +
      +
    • None
    • +
  • +
  • Other notes: + +
      +
    • The com.apple.CoreData.ConcurrencyDebug debug argument should be turned off for the app. CoreStore already guarantees safety for you by making the main context read-only, and by only executing transactions serially.
    • +
  • +

    Install with CocoaPods

    + +

    In your Podfile, add

    +
    pod 'CoreStore', '~> 5.0'
    +
    + +

    and run

    +
    pod update
    +
    + +

    This installs CoreStore as a framework. Declare import CoreStore in your swift file to use the library.

    +

    Install with Carthage

    + +

    In your Cartfile, add

    +
    github "JohnEstropia/CoreStore" >= 5.0.0
    +
    + +

    and run

    +
    carthage update
    +
    + +

    This installs CoreStore as a framework. Declare import CoreStore in your swift file to use the library.

    +

    Install as Git Submodule

    +
    git submodule add https://github.com/JohnEstropia/CoreStore.git <destination directory>
    +
    + +

    Drag and drop CoreStore.xcodeproj to your project.

    +

    To install as a framework:

    + +

    Drag and drop CoreStore.xcodeproj to your project.

    +

    To include directly in your app module:

    + +

    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.

    +

    Changesets

    + +

    For the full Changelog, refer to the Releases page.

    +

    Contact

    + +

    You can reach me on Twitter @JohnEstropia

    + +

    or join our Slack team at swift-corestore.slack.com

    + +

    日本語の対応も可能なので是非!

    +

    Who uses CoreStore?

    + +

    I’d love to hear about apps using CoreStore. Send me a message and I’ll welcome any feedback!

    +

    License

    + +

    CoreStore is released under an MIT license. See the LICENSE file for more information

    + +
    +
    + + +
    +
    + + + + diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/js/jazzy.js b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/js/jazzy.js new file mode 100755 index 0000000..009c80d --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/js/jazzy.js @@ -0,0 +1,43 @@ +window.jazzy = {'docset': false} +if (typeof window.dash != 'undefined') { + document.documentElement.className += ' dash' + window.jazzy.docset = true +} +if (navigator.userAgent.match(/xcode/i)) { + document.documentElement.className += ' xcode' + window.jazzy.docset = true +} + +// On doc load, toggle the URL hash discussion if present +$(document).ready(function() { + if (!window.jazzy.docset) { + var linkToHash = $('a[href="' + window.location.hash +'"]'); + linkToHash.trigger("click"); + } +}); + +// On token click, toggle its discussion and animate token.marginLeft +$(".token").click(function(event) { + if (window.jazzy.docset) { + return; + } + var link = $(this); + var animationDuration = 300; + $content = link.parent().parent().next(); + $content.slideToggle(animationDuration); + + // Keeps the document from jumping to the hash. + var href = $(this).attr('href'); + if (history.pushState) { + history.pushState({}, '', href); + } else { + location.hash = href; + } + event.preventDefault(); +}); + +// Dumb down quotes within code blocks that delimit strings instead of quotations +// https://github.com/realm/jazzy/issues/714 +$("code q").replaceWith(function () { + return ["\"", $(this).contents(), "\""]; +}); diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/js/jazzy.search.js b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/js/jazzy.search.js new file mode 100644 index 0000000..54be83c --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/js/jazzy.search.js @@ -0,0 +1,62 @@ +$(function(){ + var searchIndex = lunr(function() { + this.ref('url'); + this.field('name'); + }); + + var $typeahead = $('[data-typeahead]'); + var $form = $typeahead.parents('form'); + var searchURL = $form.attr('action'); + + function displayTemplate(result) { + return result.name; + } + + function suggestionTemplate(result) { + var t = '
    '; + t += '' + result.name + ''; + if (result.parent_name) { + t += '' + result.parent_name + ''; + } + t += '
    '; + return t; + } + + $typeahead.one('focus', function() { + $form.addClass('loading'); + + $.getJSON(searchURL).then(function(searchData) { + $.each(searchData, function (url, doc) { + searchIndex.add({url: url, name: doc.name}); + }); + + $typeahead.typeahead( + { + highlight: true, + minLength: 3 + }, + { + limit: 10, + display: displayTemplate, + templates: { suggestion: suggestionTemplate }, + source: function(query, sync) { + var results = searchIndex.search(query).map(function(result) { + var doc = searchData[result.ref]; + doc.url = result.ref; + return doc; + }); + sync(results); + } + } + ); + $form.removeClass('loading'); + $typeahead.trigger('focus'); + }); + }); + + var baseURL = searchURL.slice(0, -"search.json".length); + + $typeahead.on('typeahead:select', function(e, result) { + window.location = baseURL + result.url; + }); +}); diff --git a/docs/docsets/CoreStore.docset/Contents/Resources/Documents/js/jquery.min.js b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/js/jquery.min.js new file mode 100755 index 0000000..ab28a24 --- /dev/null +++ b/docs/docsets/CoreStore.docset/Contents/Resources/Documents/js/jquery.min.js @@ -0,0 +1,4 @@ +/*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ +!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.1",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="
    ",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h; +if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML="
    a",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/\s*$/g,rb={option:[1,""],legend:[1,"
    ","
    "],area:[1,"",""],param:[1,"",""],thead:[1,"","
    "],tr:[2,"","
    "],col:[2,"","
    "],td:[3,"","
    "],_default:k.htmlSerialize?[0,"",""]:[1,"X
    ","
    "]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?""!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("