diff --git a/DBClient.podspec b/DBClient.podspec index c44954b..38bdc3e 100644 --- a/DBClient.podspec +++ b/DBClient.podspec @@ -29,7 +29,7 @@ Pod::Spec.new do |s| s.subspec "Realm" do |spec| spec.dependency "DBClient/Core" spec.source_files = ['DBClient/Realm/*.swift'] - spec.dependency "RealmSwift", "~> 2.1.1" + spec.dependency "RealmSwift", "~> 2.8.1" end end \ No newline at end of file diff --git a/DBClient/CoreData/CoreDataObservable.swift b/DBClient/CoreData/CoreDataObservable.swift index 2b1ff58..4014e07 100644 --- a/DBClient/CoreData/CoreDataObservable.swift +++ b/DBClient/CoreData/CoreDataObservable.swift @@ -112,7 +112,9 @@ private class FetchedResultsControllerDelegate: NSObject, NS let inserted = batchChanges.filter { $0.isInsertion }.map { (index: $0.index(), element: $0.object()) } let updated = batchChanges.filter { $0.isUpdate }.map { (index: $0.index(), element: $0.object()) } - observer?(.change(objects: controller.fetchedObjects as? [T] ?? [], deletions: deleted, insertions: inserted, modifications: updated)) + if let observer = observer { + observer(.change(objects: controller.fetchedObjects as? [T] ?? [], deletions: deleted, insertions: inserted, modifications: updated)) + } batchChanges = [] } diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj index 99faf38..64fe0c4 100644 --- a/Example/Example.xcodeproj/project.pbxproj +++ b/Example/Example.xcodeproj/project.pbxproj @@ -151,7 +151,6 @@ C53372531E26155D004ECBCF /* Frameworks */, C53372541E26155D004ECBCF /* Resources */, 5DD0265501157C9DFB18D487 /* [CP] Embed Pods Frameworks */, - 3E7D40D093AC662DD66ED84E /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -210,30 +209,24 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 3E7D40D093AC662DD66ED84E /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Example/Pods-Example-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; 5DD0265501157C9DFB18D487 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-Example/Pods-Example-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Bolts-Swift/BoltsSwift.framework", + "${BUILT_PRODUCTS_DIR}/DBClient/DBClient.framework", + "${BUILT_PRODUCTS_DIR}/Realm/Realm.framework", + "${BUILT_PRODUCTS_DIR}/RealmSwift/RealmSwift.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/BoltsSwift.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DBClient.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Realm.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RealmSwift.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -246,13 +239,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Example-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 404cdb4..546f43f 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -6,27 +6,33 @@ PODS: - DBClient/Core - DBClient/Realm (0.1): - DBClient/Core - - RealmSwift (~> 2.1.1) - - Realm (2.1.2): - - Realm/Headers (= 2.1.2) - - Realm/Headers (2.1.2) - - RealmSwift (2.1.2): - - Realm (= 2.1.2) + - RealmSwift (~> 2.8.1) + - Realm (2.8.3): + - Realm/Headers (= 2.8.3) + - Realm/Headers (2.8.3) + - RealmSwift (2.8.3): + - Realm (= 2.8.3) DEPENDENCIES: - DBClient/CoreData (from `../`) - DBClient/Realm (from `../`) +SPEC REPOS: + https://github.com/CocoaPods/Specs.git: + - Bolts-Swift + - Realm + - RealmSwift + EXTERNAL SOURCES: DBClient: - :path: ../ + :path: "../" SPEC CHECKSUMS: Bolts-Swift: fa98d1b59fc1acea9b21a21306dcdca1c85e3737 - DBClient: fcf29df338854a8509d00cad7356ab3190be4006 - Realm: efe855f4d977c8ce5a82d3116d9f1ff155a6550c - RealmSwift: 17d6ee30b6f9df86364408c2197492e33bfea567 + DBClient: 464c0e9e1c858564657ce8c72ef80409c3b5e79d + Realm: 3601ef091c8c499a31101d8563b991e75546cdce + RealmSwift: 8183818515471b01a99abdd2970f8e4fd52b6f4a PODFILE CHECKSUM: 179eda0e5897e0216cdd26b5cd14adae089b4671 -COCOAPODS: 1.2.0 +COCOAPODS: 1.5.0