Skip to content

Commit 60af541

Browse files
Adapted RxSwift 4.0 & RxDataSources 3.0 (#5)
* Update to RxSwift 4.0 and RxDataSources 3.0 * Fix Example * Fix Example * Update ASCollectionSectionedDataSource * Update DataSource Proxies
1 parent 3b5f407 commit 60af541

34 files changed

+629
-610
lines changed

.gitignore

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Xcode
2+
#
3+
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4+
5+
## Build generated
6+
build/
7+
DerivedData/
8+
9+
## Various settings
10+
*.pbxuser
11+
!default.pbxuser
12+
*.mode1v3
13+
!default.mode1v3
14+
*.mode2v3
15+
!default.mode2v3
16+
*.perspectivev3
17+
!default.perspectivev3
18+
xcuserdata/
19+
20+
## Other
21+
*.moved-aside
22+
*.xcuserstate
23+
24+
## Obj-C/Swift specific
25+
*.hmap
26+
*.ipa
27+
*.dSYM.zip
28+
*.dSYM
29+
30+
## Playgrounds
31+
timeline.xctimeline
32+
playground.xcworkspace
33+
34+
# Swift Package Manager
35+
#
36+
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
37+
# Packages/
38+
.build/
39+
40+
# CocoaPods
41+
#
42+
# We recommend against adding the Pods directory to your .gitignore. However
43+
# you should judge for yourself, the pros and cons are mentioned at:
44+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
45+
#
46+
Pods/
47+
48+
# Carthage
49+
#
50+
# Add this line if you want to avoid checking in source code from Carthage dependencies.
51+
Carthage/Checkouts
52+
53+
Carthage/Build
54+
55+
# fastlane
56+
#
57+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
58+
# screenshots whenever they are needed.
59+
# For more information about the recommended setup visit:
60+
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
61+
62+
fastlane/report.xml
63+
fastlane/Preview.html
64+
fastlane/screenshots
65+
fastlane/test_output

.gitmodules

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
url = https://github.com/pinterest/PINCache.git
1313
[submodule "Carthage/Checkouts/RxSwift"]
1414
url = https://github.com/ReactiveX/RxSwift.git
15+
path = Carthage/Checkouts/RxSwift
1516
[submodule "Carthage/Checkouts/texture"]
1617
path = Carthage/Checkouts/texture
1718
url = https://github.com/texturegroup/texture.git

Cartfile.resolved

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
git "https://chromium.googlesource.com/webm/libwebp" "v0.5.1"
2-
github "ReactiveX/RxSwift" "3.6.1"
3-
github "RxSwiftCommunity/RxDataSources" "2.0.2"
2+
github "ReactiveX/RxSwift" "4.0.0"
3+
github "RxSwiftCommunity/RxDataSources" "3.0.2"
44
github "pinterest/PINCache" "3.0.1-beta.5"
55
github "pinterest/PINOperation" "1.0.3"
6-
github "pinterest/PINRemoteImage" "3.0.0-beta.11"
7-
github "texturegroup/texture" "2.4"
6+
github "pinterest/PINRemoteImage" "3.0.0-beta.12"
7+
github "texturegroup/texture" "2.5.1"

Carthage/Checkouts/RxDataSources

Submodule RxDataSources updated 46 files

Carthage/Checkouts/RxSwift

Submodule RxSwift updated 393 files

Carthage/Checkouts/texture

Submodule texture updated 140 files

Example/ViewController.swift

+17-16
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ extension NumberSection: AnimatableSectionModelType {
4848
extension IntItem: IdentifiableType, Equatable {
4949
typealias Identity = Int
5050
var identity: Int {
51-
return number.hashValue
51+
return number
5252
}
5353
}
5454

@@ -59,23 +59,24 @@ func ==(lhs: IntItem, rhs: IntItem) -> Bool {
5959
class ViewController: UIViewController {
6060

6161
let tableNode = ASTableNode()
62-
private let dataSource = RxASTableAnimatedDataSource<NumberSection>()
6362

6463
private let disposeBag = DisposeBag()
6564
override func viewDidLoad() {
6665
super.viewDidLoad()
6766
self.view.addSubnode(tableNode)
6867

69-
dataSource.configureCell = { (_, tv, ip, i) in
68+
let configureCell: ASTableSectionedDataSource<NumberSection>.ConfigureCell = { (_, tableNode, index, i) in
7069
let cell = ASTextCellNode()
7170
cell.text = "\(i.number)"
7271
return cell
7372
}
74-
75-
dataSource.titleForHeaderInSection = { (dataSource, section) -> String? in
73+
74+
let titleForHeaderInSection: ASTableSectionedDataSource<NumberSection>.TitleForHeaderInSection = { (dataSource, section) -> String? in
7675
return dataSource[section].header
7776
}
7877

78+
let dataSource = RxASTableAnimatedDataSource<NumberSection>(configureCell: configureCell, titleForHeaderInSection: titleForHeaderInSection)
79+
7980
Observable<Int>
8081
.interval(2.0, scheduler: MainScheduler.instance)
8182
.map { _ in
@@ -105,19 +106,19 @@ class ViewController: UIViewController {
105106
}
106107
}
107108

108-
func $(_ numbers: [Int]) -> [IntItem] {
109+
func items(_ numbers: [Int]) -> [IntItem] {
109110
return numbers.map { IntItem(number: $0, date: Date()) }
110111
}
111112

112113
let _initialValue: [NumberSection] = [
113-
NumberSection(header: "section 1", numbers: $([1, 2, 3]), updated: Date()),
114-
NumberSection(header: "section 2", numbers: $([4, 5, 6]), updated: Date()),
115-
NumberSection(header: "section 3", numbers: $([7, 8, 9]), updated: Date()),
116-
NumberSection(header: "section 4", numbers: $([10, 11, 12]), updated: Date()),
117-
NumberSection(header: "section 5", numbers: $([13, 14, 15]), updated: Date()),
118-
NumberSection(header: "section 6", numbers: $([16, 17, 18]), updated: Date()),
119-
NumberSection(header: "section 7", numbers: $([19, 20, 21]), updated: Date()),
120-
NumberSection(header: "section 8", numbers: $([22, 23, 24]), updated: Date()),
121-
NumberSection(header: "section 9", numbers: $([25, 26, 27]), updated: Date()),
122-
NumberSection(header: "section 10", numbers: $([28, 29, 30]), updated: Date())
114+
NumberSection(header: "section 1", numbers: items([1, 2, 3]), updated: Date()),
115+
NumberSection(header: "section 2", numbers: items([4, 5, 6]), updated: Date()),
116+
NumberSection(header: "section 3", numbers: items([7, 8, 9]), updated: Date()),
117+
NumberSection(header: "section 4", numbers: items([10, 11, 12]), updated: Date()),
118+
NumberSection(header: "section 5", numbers: items([13, 14, 15]), updated: Date()),
119+
NumberSection(header: "section 6", numbers: items([16, 17, 18]), updated: Date()),
120+
NumberSection(header: "section 7", numbers: items([19, 20, 21]), updated: Date()),
121+
NumberSection(header: "section 8", numbers: items([22, 23, 24]), updated: Date()),
122+
NumberSection(header: "section 9", numbers: items([25, 26, 27]), updated: Date()),
123+
NumberSection(header: "section 10", numbers: items([28, 29, 30]), updated: Date())
123124
]

Podfile.lock

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- Differentiator (2.0.2)
2+
- Differentiator (3.0.2)
33
- PINCache (3.0.1-beta.5):
44
- PINCache/Arc-exception-safe (= 3.0.1-beta.5)
55
- PINCache/Core (= 3.0.1-beta.5)
@@ -8,21 +8,21 @@ PODS:
88
- PINCache/Core (3.0.1-beta.5):
99
- PINOperation (= 1.0.3)
1010
- PINOperation (1.0.3)
11-
- PINRemoteImage/Core (3.0.0-beta.11):
11+
- PINRemoteImage/Core (3.0.0-beta.12):
1212
- PINOperation
13-
- PINRemoteImage/iOS (3.0.0-beta.11):
13+
- PINRemoteImage/iOS (3.0.0-beta.12):
1414
- PINRemoteImage/Core
15-
- PINRemoteImage/PINCache (3.0.0-beta.11):
15+
- PINRemoteImage/PINCache (3.0.0-beta.12):
1616
- PINCache (= 3.0.1-beta.5)
1717
- PINRemoteImage/Core
18-
- RxCocoa (3.6.1):
19-
- RxSwift (~> 3.6)
20-
- RxSwift (3.6.1)
21-
- Texture (2.4):
22-
- Texture/PINRemoteImage (= 2.4)
23-
- Texture/Core (2.4)
24-
- Texture/PINRemoteImage (2.4):
25-
- PINRemoteImage/iOS (= 3.0.0-beta.11)
18+
- RxCocoa (4.0.0):
19+
- RxSwift (~> 4.0)
20+
- RxSwift (4.0.0)
21+
- Texture (2.5.1):
22+
- Texture/PINRemoteImage (= 2.5.1)
23+
- Texture/Core (2.5.1)
24+
- Texture/PINRemoteImage (2.5.1):
25+
- PINRemoteImage/iOS (= 3.0.0-beta.12)
2626
- PINRemoteImage/PINCache
2727
- Texture/Core
2828

@@ -33,14 +33,14 @@ DEPENDENCIES:
3333
- Texture
3434

3535
SPEC CHECKSUMS:
36-
Differentiator: caa9b3957981a2ac8e6b2eac8a676af461caa604
36+
Differentiator: a87be69eba49ec4ab460c7671143ee3a9eececfd
3737
PINCache: 98e7b1ef782824ad231ade51987c218b758c30d8
3838
PINOperation: ac23db44796d4a564ecf9b5ea7163510f579b71d
39-
PINRemoteImage: d71988f11914a050d6d4cf51efc4ad1de8c0a9d8
40-
RxCocoa: 84a08739ab186248c7f31ce4ee92d6f8a947d690
41-
RxSwift: f9de85ea20cd2f7716ee5409fc13523dc638e4e4
42-
Texture: a5526314780eab35f642d956627f09316b9514e8
39+
PINRemoteImage: 0cefe720c2612960bd360710efbd6c73a1991d5f
40+
RxCocoa: d62846ca96495d862fa4c59ea7d87e5031d7340e
41+
RxSwift: fd680d75283beb5e2559486f3c0ff852f0d35334
42+
Texture: c3f06e344aa091667b7a56002e525cde674d021a
4343

4444
PODFILE CHECKSUM: df58f9cead49c76984203f4eab4ded96071c8990
4545

46-
COCOAPODS: 1.3.0
46+
COCOAPODS: 1.3.1

Readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
## Requirements
1717

1818
- iOS 8.0+
19-
- Xcode 8.0+
19+
- Xcode 9.0+
2020

2121
## Installation
2222

RxASDataSources.podspec

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'RxASDataSources'
3-
s.version = '0.2'
3+
s.version = '0.3'
44
s.license = { :type => "MIT", :file => "LICENSE" }
55
s.summary = 'RxDataSources for AsyncDisplayKit/Texture ASTableNode/ASCollectionNode'
66
s.homepage = 'https://github.com/dangthaison91/RxASDataSources'
@@ -12,9 +12,9 @@ Pod::Spec.new do |s|
1212

1313
s.source_files = "Sources/**/*.swift"
1414
s.framework = "Foundation"
15-
s.dependency 'RxSwift', '~> 3.4'
16-
s.dependency 'RxCocoa', '~> 3.4'
17-
s.dependency 'Differentiator', '~> 2.0'
18-
s.dependency 'Texture', '~> 2.0'
15+
s.dependency 'RxSwift', '~> 4.0'
16+
s.dependency 'RxCocoa', '~> 4.0'
17+
s.dependency 'Differentiator', '~> 3.0'
18+
s.dependency 'Texture', '~> 2.5'
1919

2020
end

0 commit comments

Comments
 (0)