diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 268d6ae..df74c65 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -6,9 +6,13 @@ on: jobs: build: - runs-on: macos-11.0 + runs-on: macos-latest steps: + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + - uses: actions/checkout@v2 with: fetch-depth: 0 diff --git a/Cartfile b/Cartfile index 558afd3..ceec564 100644 --- a/Cartfile +++ b/Cartfile @@ -1,2 +1,2 @@ -github "realm/realm-cocoa" ~> 10.5 +github "realm/realm-cocoa" ~> 10.21 github "ReactiveX/RxSwift" ~> 6.1 diff --git a/Cartfile.resolved b/Cartfile.resolved index c04edab..1191c58 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,2 +1,2 @@ -github "ReactiveX/RxSwift" "6.0.0" -github "realm/realm-cocoa" "v10.5.0" \ No newline at end of file +github "ReactiveX/RxSwift" "6.5.0" +github "realm/realm-cocoa" "v10.21.1" diff --git a/Examples/Podfile.lock b/Examples/Podfile.lock index 47c03b0..9f29b68 100644 --- a/Examples/Podfile.lock +++ b/Examples/Podfile.lock @@ -1,20 +1,20 @@ PODS: - - Realm (10.7.4): - - Realm/Headers (= 10.7.4) - - Realm/Headers (10.7.4) - - RealmSwift (10.7.4): - - Realm (= 10.7.4) - - RxCocoa (6.1.0): - - RxRelay (= 6.1.0) - - RxSwift (= 6.1.0) - - RxRealm (5.0.1): - - Realm (~> 10.7) - - RealmSwift (~> 10.7) - - RxCocoa (~> 6.0) - - RxSwift (~> 6.0) - - RxRelay (6.1.0): - - RxSwift (= 6.1.0) - - RxSwift (6.1.0) + - Realm (10.21.1): + - Realm/Headers (= 10.21.1) + - Realm/Headers (10.21.1) + - RealmSwift (10.21.1): + - Realm (= 10.21.1) + - RxCocoa (6.5.0): + - RxRelay (= 6.5.0) + - RxSwift (= 6.5.0) + - RxRealm (5.0.4): + - Realm (~> 10.21) + - RealmSwift (~> 10.21) + - RxCocoa (~> 6.1) + - RxSwift (~> 6.1) + - RxRelay (6.5.0): + - RxSwift (= 6.5.0) + - RxSwift (6.5.0) DEPENDENCIES: - RxRealm (from `../`) @@ -32,13 +32,13 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - Realm: f08ce1a85649a41303ecfe1cbd914c62e9e6d710 - RealmSwift: 60ec49d165f23d040ab48811d8dd177e09baf4d3 - RxCocoa: 5c51f02d562cbd94629f6c26cf0c80fe4ab8d343 - RxRealm: fc4a4bc4956f2b7be27412a22eda143785da0c85 - RxRelay: 483e1a19fad961b41f0b0c0bee506f46c1ae14fe - RxSwift: a834e5c538e89eca0cae86f403f4fbf0336786ce + Realm: 44b41c3ae39e3ecfded71a04434bfde066c7b317 + RealmSwift: dbf9a4eb06e0c929d51c4ef2e8f951bca541feab + RxCocoa: 94f817b71c07517321eb4f9ad299112ca8af743b + RxRealm: 666c8785327fe2fff972a3093b35dc7055c1ca38 + RxRelay: 1de1523e604c72b6c68feadedd1af3b1b4d0ecbd + RxSwift: 5710a9e6b17f3c3d6e40d6e559b9fa1e813b2ef8 PODFILE CHECKSUM: c18aa0767a67d16eff537312e81255933c8a0f4e -COCOAPODS: 1.10.1 +COCOAPODS: 1.11.2 diff --git a/Package.resolved b/Package.resolved index d35d30d..8fb9fbc 100644 --- a/Package.resolved +++ b/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/realm/realm-cocoa.git", "state": { "branch": null, - "revision": "c236b2c1270fe41ba7c101a1d17ef56494987cb9", - "version": "10.5.0" + "revision": "39177714b95bb5b1b29fffe28f1c7da77eef8e8b", + "version": "10.21.1" } }, { @@ -15,8 +15,8 @@ "repositoryURL": "https://github.com/realm/realm-core", "state": { "branch": null, - "revision": "7390723ae39b432bd00f093ea84e3b79534a202c", - "version": "10.3.2" + "revision": "f1976f0d96d9b06fbe0afbd60090b1c3966b1e23", + "version": "11.8.0" } }, { @@ -24,8 +24,8 @@ "repositoryURL": "https://github.com/ReactiveX/RxSwift.git", "state": { "branch": null, - "revision": "c8742ed97fc2f0c015a5ea5eddefb064cd7532d2", - "version": "6.0.0" + "revision": "b4307ba0b6425c0ba4178e138799946c3da594f8", + "version": "6.5.0" } } ] diff --git a/Package.swift b/Package.swift index 086f3fb..efd704b 100644 --- a/Package.swift +++ b/Package.swift @@ -15,8 +15,8 @@ let package = Package(name: "RxRealm", dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/realm/realm-cocoa.git", .upToNextMajor(from: "10.5.0")), - .package(url: "https://github.com/ReactiveX/RxSwift.git", .upToNextMajor(from: "6.1.0")) + .package(url: "https://github.com/realm/realm-cocoa.git", .upToNextMajor(from: "10.21.1")), + .package(url: "https://github.com/ReactiveX/RxSwift.git", .upToNextMajor(from: "6.5.0")) ], targets: [ diff --git a/RxRealm.podspec b/RxRealm.podspec index 83ebb5f..8dee75d 100644 --- a/RxRealm.podspec +++ b/RxRealm.podspec @@ -24,8 +24,8 @@ Pod::Spec.new do |s| s.source_files = "Sources/RxRealm/*.swift" s.frameworks = "Foundation" - s.dependency "Realm", "~> 10.7" - s.dependency "RealmSwift", "~> 10.7" + s.dependency "Realm", "~> 10.21" + s.dependency "RealmSwift", "~> 10.21" s.dependency "RxSwift", "~> 6.1" s.dependency "RxCocoa", "~> 6.1" end diff --git a/Sources/RxRealm/RxRealm.swift b/Sources/RxRealm/RxRealm.swift index 2f0f405..a40affe 100644 --- a/Sources/RxRealm/RxRealm.swift +++ b/Sources/RxRealm/RxRealm.swift @@ -32,7 +32,9 @@ public protocol NotificationEmitter { - returns: `NotificationToken` - retain this value to keep notifications being emitted for the current collection. */ - func observe(on queue: DispatchQueue?, _ block: @escaping (RealmCollectionChange) -> Void) -> NotificationToken + func observe(keyPaths: [String]?, + on queue: DispatchQueue?, + _ block: @escaping (RealmCollectionChange) -> Void) -> NotificationToken func toArray() -> [ElementType] @@ -111,18 +113,20 @@ public extension ObservableType where Element: NotificationEmitter { - parameter from: A Realm collection of type `Element`: either `Results`, `List`, `LinkingObjects` or `AnyRealmCollection`. - parameter synchronousStart: whether the resulting `Observable` should emit its first element synchronously (e.g. better for UI bindings) + - parameter keyPaths: Only properties contained in the key paths array will trigger + the block when they are modified. See description above for more detail on linked properties. - parameter queue: The serial dispatch queue to receive notification on. If `nil`, notifications are delivered to the current thread. - returns: `Observable`, e.g. when called on `Results` it will return `Observable>`, on a `List` it will return `Observable>`, etc. */ - static func collection(from collection: Element, synchronousStart: Bool = true, on queue: DispatchQueue? = nil) + static func collection(from collection: Element, synchronousStart: Bool = true, keyPaths: [String]? = nil, on queue: DispatchQueue? = nil) -> Observable { return Observable.create { observer in if synchronousStart { observer.onNext(collection) } - let token = collection.observe(on: queue) { changeset in + let token = collection.observe(keyPaths: keyPaths, on: queue) { changeset in let value: Element diff --git a/project-spm.yml b/project-spm.yml index 86cdd90..934f3f6 100644 --- a/project-spm.yml +++ b/project-spm.yml @@ -98,7 +98,7 @@ packages: from: 6.0.0 Realm: url: https://github.com/realm/realm-cocoa.git - from: 10.5.0 + from: 10.21.1 targets: RxRealm iOS: settings: