Skip to content

Commit

Permalink
fix: update Realm and RxSwift to latest version (#178)
Browse files Browse the repository at this point in the history
* fix: update realm to v10.21.0

* fix: update dependencies

* chore: use latest xcode

* chore: update package.swift
  • Loading branch information
lihao6485 authored Jan 19, 2022
1 parent 23ec894 commit 63d00c6
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 41 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "realm/realm-cocoa" ~> 10.5
github "realm/realm-cocoa" ~> 10.21
github "ReactiveX/RxSwift" ~> 6.1
4 changes: 2 additions & 2 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "ReactiveX/RxSwift" "6.0.0"
github "realm/realm-cocoa" "v10.5.0"
github "ReactiveX/RxSwift" "6.5.0"
github "realm/realm-cocoa" "v10.21.1"
46 changes: 23 additions & 23 deletions Examples/Podfile.lock
Original file line number Diff line number Diff line change
@@ -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 `../`)
Expand All @@ -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
12 changes: 6 additions & 6 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@
"repositoryURL": "https://github.com/realm/realm-cocoa.git",
"state": {
"branch": null,
"revision": "c236b2c1270fe41ba7c101a1d17ef56494987cb9",
"version": "10.5.0"
"revision": "39177714b95bb5b1b29fffe28f1c7da77eef8e8b",
"version": "10.21.1"
}
},
{
"package": "RealmDatabase",
"repositoryURL": "https://github.com/realm/realm-core",
"state": {
"branch": null,
"revision": "7390723ae39b432bd00f093ea84e3b79534a202c",
"version": "10.3.2"
"revision": "f1976f0d96d9b06fbe0afbd60090b1c3966b1e23",
"version": "11.8.0"
}
},
{
"package": "RxSwift",
"repositoryURL": "https://github.com/ReactiveX/RxSwift.git",
"state": {
"branch": null,
"revision": "c8742ed97fc2f0c015a5ea5eddefb064cd7532d2",
"version": "6.0.0"
"revision": "b4307ba0b6425c0ba4178e138799946c3da594f8",
"version": "6.5.0"
}
}
]
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
4 changes: 2 additions & 2 deletions RxRealm.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 7 additions & 3 deletions Sources/RxRealm/RxRealm.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<Self>) -> Void) -> NotificationToken
func observe(keyPaths: [String]?,
on queue: DispatchQueue?,
_ block: @escaping (RealmCollectionChange<Self>) -> Void) -> NotificationToken

func toArray() -> [ElementType]

Expand Down Expand Up @@ -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<Element>`, e.g. when called on `Results<Model>` it will return `Observable<Results<Model>>`, on a `List<User>` it will return `Observable<List<User>>`, 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<Element> {
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

Expand Down
2 changes: 1 addition & 1 deletion project-spm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 63d00c6

Please sign in to comment.