Skip to content

Commit 68556d3

Browse files
committed
Release 1.0.0-rc.2
1 parent 2a0a3e8 commit 68556d3

14 files changed

+147
-216
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file.
33

44
---
55

6+
## [1.0.0-rc.2](https://github.com/RxSwiftCommunity/RxDataSources/releases/tag/1.0.0-rc.2)
7+
8+
#### Features
9+
10+
* Makes rest of data source classes and methods open.
11+
* Small polish for UI.
12+
* Removes part of deprecated extensions.
13+
614
## [1.0.0-rc.1](https://github.com/RxSwiftCommunity/RxDataSources/releases/tag/1.0.0-rc.1)
715

816
#### Features

Example/Base.lproj/Main.storyboard

Lines changed: 57 additions & 73 deletions
Large diffs are not rendered by default.

Example/Example2_RandomizedSectionsAnimation.swift

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,7 @@ extension ViewController {
118118
// MARK: Initial value
119119

120120
func initialValue() -> [NumberSection] {
121-
let generate = true
122-
if generate {
123-
121+
#if true
124122
let nSections = 10
125123
let nItems = 100
126124

@@ -133,10 +131,9 @@ extension ViewController {
133131
return (0 ..< nSections).map { (i: Int) in
134132
NumberSection(header: "Section \(i + 1)", numbers: $(Array(i * nItems ..< (i + 1) * nItems)), updated: Date())
135133
}
136-
}
137-
else {
134+
#else
138135
return _initialValue
139-
}
136+
#endif
140137
}
141138

142139

Example/Example4_DifferentSectionAndItemTypes.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class MultipleSectionModelViewController: UIViewController {
6262
}
6363

6464
dataSource.titleForHeaderInSection = { dataSource, index in
65-
let section = dataSource.sectionAtIndex(index)
65+
let section = dataSource[index]
6666

6767
return section.title
6868
}

Example/Support/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1414
var window: UIWindow?
1515

1616

17-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
17+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
1818
// Override point for customization after application launch.
1919
return true
2020
}

RxDataSources.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "RxDataSources"
3-
s.version = "1.0.0-rc.1"
3+
s.version = "1.0.0-rc.2"
44
s.summary = "This is a collection of reactive data sources for UITableView and UICollectionView."
55
s.description = <<-DESC
66
This is a collection of reactive data sources for UITableView and UICollectionView.

RxDataSources.xcodeproj/project.pbxproj

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
9FCDA1751C3AF4A2000F5F94 /* RxCollectionViewSectionedReloadDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85EE5531C36F1FC0090614D /* RxCollectionViewSectionedReloadDataSource.swift */; };
3131
9FCDA1761C3AF4A2000F5F94 /* RxTableViewSectionedAnimatedDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85EE5541C36F1FC0090614D /* RxTableViewSectionedAnimatedDataSource.swift */; };
3232
9FCDA1771C3AF4A2000F5F94 /* RxTableViewSectionedReloadDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85EE5551C36F1FC0090614D /* RxTableViewSectionedReloadDataSource.swift */; };
33-
9FCDA1781C3AF4A2000F5F94 /* UISectionedViewType+RxAnimatedDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85EE5561C36F1FC0090614D /* UISectionedViewType+RxAnimatedDataSource.swift */; };
3433
9FF3014A1C4AA6D1007376BD /* RxCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FF301481C4AA6D1007376BD /* RxCocoa.framework */; };
3534
9FF3014B1C4AA6D1007376BD /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FF301491C4AA6D1007376BD /* RxSwift.framework */; };
3635
9FF3014E1C4AA6DA007376BD /* RxCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FF3014C1C4AA6DA007376BD /* RxCocoa.framework */; };
@@ -56,7 +55,6 @@
5655
C85EE5611C36F1FC0090614D /* RxCollectionViewSectionedReloadDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85EE5531C36F1FC0090614D /* RxCollectionViewSectionedReloadDataSource.swift */; };
5756
C85EE5621C36F1FC0090614D /* RxTableViewSectionedAnimatedDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85EE5541C36F1FC0090614D /* RxTableViewSectionedAnimatedDataSource.swift */; };
5857
C85EE5631C36F1FC0090614D /* RxTableViewSectionedReloadDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85EE5551C36F1FC0090614D /* RxTableViewSectionedReloadDataSource.swift */; };
59-
C85EE5641C36F1FC0090614D /* UISectionedViewType+RxAnimatedDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85EE5561C36F1FC0090614D /* UISectionedViewType+RxAnimatedDataSource.swift */; };
6058
C87DF3461D0219A7006308C5 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C87DF3431D0219A7006308C5 /* AppDelegate.swift */; };
6159
C87DF3471D0219A7006308C5 /* NumberSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = C87DF3441D0219A7006308C5 /* NumberSection.swift */; };
6260
C87DF3481D0219A7006308C5 /* Randomizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = C87DF3451D0219A7006308C5 /* Randomizer.swift */; };
@@ -103,7 +101,6 @@
103101
C8BB76661C4C3E53002B21C8 /* SectionModelType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85EE54E1C36F1FC0090614D /* SectionModelType.swift */; };
104102
C8BB76671C4C3E53002B21C8 /* AnimatableSectionModelType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8BB76241C4C3CDF002B21C8 /* AnimatableSectionModelType.swift */; };
105103
C8BB76691C4C3E53002B21C8 /* Differentiator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85EE54B1C36F1FC0090614D /* Differentiator.swift */; };
106-
C8BB766A1C4C3E53002B21C8 /* UISectionedViewType+RxAnimatedDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85EE5561C36F1FC0090614D /* UISectionedViewType+RxAnimatedDataSource.swift */; };
107104
C8BB766C1C4C3E53002B21C8 /* RxTableViewSectionedReloadDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85EE5551C36F1FC0090614D /* RxTableViewSectionedReloadDataSource.swift */; };
108105
C8BB766D1C4C3E53002B21C8 /* CollectionViewSectionedDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85EE5491C36F1FC0090614D /* CollectionViewSectionedDataSource.swift */; };
109106
C8BB766E1C4C3E53002B21C8 /* TableViewSectionedDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85EE54F1C36F1FC0090614D /* TableViewSectionedDataSource.swift */; };
@@ -212,7 +209,6 @@
212209
C85EE5531C36F1FC0090614D /* RxCollectionViewSectionedReloadDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxCollectionViewSectionedReloadDataSource.swift; sourceTree = "<group>"; };
213210
C85EE5541C36F1FC0090614D /* RxTableViewSectionedAnimatedDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxTableViewSectionedAnimatedDataSource.swift; sourceTree = "<group>"; };
214211
C85EE5551C36F1FC0090614D /* RxTableViewSectionedReloadDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxTableViewSectionedReloadDataSource.swift; sourceTree = "<group>"; };
215-
C85EE5561C36F1FC0090614D /* UISectionedViewType+RxAnimatedDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UISectionedViewType+RxAnimatedDataSource.swift"; sourceTree = "<group>"; };
216212
C87DF3431D0219A7006308C5 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
217213
C87DF3441D0219A7006308C5 /* NumberSection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NumberSection.swift; sourceTree = "<group>"; };
218214
C87DF3451D0219A7006308C5 /* Randomizer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Randomizer.swift; sourceTree = "<group>"; };
@@ -403,7 +399,6 @@
403399
C85EE5531C36F1FC0090614D /* RxCollectionViewSectionedReloadDataSource.swift */,
404400
C85EE5541C36F1FC0090614D /* RxTableViewSectionedAnimatedDataSource.swift */,
405401
C85EE5551C36F1FC0090614D /* RxTableViewSectionedReloadDataSource.swift */,
406-
C85EE5561C36F1FC0090614D /* UISectionedViewType+RxAnimatedDataSource.swift */,
407402
);
408403
path = "DataSources+Rx";
409404
sourceTree = "<group>";
@@ -819,7 +814,6 @@
819814
9FCDA1711C3AF4A2000F5F94 /* SectionModelType.swift in Sources */,
820815
C8BB762F1C4C3CDF002B21C8 /* AnimatableSectionModelType.swift in Sources */,
821816
9FCDA16E1C3AF4A2000F5F94 /* Differentiator.swift in Sources */,
822-
9FCDA1781C3AF4A2000F5F94 /* UISectionedViewType+RxAnimatedDataSource.swift in Sources */,
823817
C8477FBB1D29DBC90074454A /* IntegerType+IdentifiableType.swift in Sources */,
824818
9FCDA1771C3AF4A2000F5F94 /* RxTableViewSectionedReloadDataSource.swift in Sources */,
825819
9FCDA16C1C3AF4A2000F5F94 /* CollectionViewSectionedDataSource.swift in Sources */,
@@ -851,7 +845,6 @@
851845
C85EE55D1C36F1FC0090614D /* SectionModelType.swift in Sources */,
852846
C8BB762E1C4C3CDF002B21C8 /* AnimatableSectionModelType.swift in Sources */,
853847
C85EE55A1C36F1FC0090614D /* Differentiator.swift in Sources */,
854-
C85EE5641C36F1FC0090614D /* UISectionedViewType+RxAnimatedDataSource.swift in Sources */,
855848
C8477FBA1D29DBC90074454A /* IntegerType+IdentifiableType.swift in Sources */,
856849
C85EE5631C36F1FC0090614D /* RxTableViewSectionedReloadDataSource.swift in Sources */,
857850
C85EE5581C36F1FC0090614D /* CollectionViewSectionedDataSource.swift in Sources */,
@@ -927,7 +920,6 @@
927920
C8BB76661C4C3E53002B21C8 /* SectionModelType.swift in Sources */,
928921
C8BB76671C4C3E53002B21C8 /* AnimatableSectionModelType.swift in Sources */,
929922
C8BB76691C4C3E53002B21C8 /* Differentiator.swift in Sources */,
930-
C8BB766A1C4C3E53002B21C8 /* UISectionedViewType+RxAnimatedDataSource.swift in Sources */,
931923
C8477FB91D29DBC90074454A /* IntegerType+IdentifiableType.swift in Sources */,
932924
C8BB766C1C4C3E53002B21C8 /* RxTableViewSectionedReloadDataSource.swift in Sources */,
933925
C8BB766D1C4C3E53002B21C8 /* CollectionViewSectionedDataSource.swift in Sources */,

Sources/DataSources+Rx/RxCollectionViewSectionedAnimatedDataSource.swift

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import RxCocoa
1717
This is commented becuse collection view has bugs when doing animated updates.
1818
Take a look at randomized sections.
1919
*/
20-
public class RxCollectionViewSectionedAnimatedDataSource<S: AnimatableSectionModelType>
20+
open class RxCollectionViewSectionedAnimatedDataSource<S: AnimatableSectionModelType>
2121
: CollectionViewSectionedDataSource<S>
2222
, RxCollectionViewDataSourceType {
2323
public typealias Element = [S]
@@ -44,12 +44,16 @@ public class RxCollectionViewSectionedAnimatedDataSource<S: AnimatableSectionMod
4444
// help to alleviate the issues with them.
4545
.throttle(0.5, scheduler: MainScheduler.instance)
4646
.subscribe(onNext: { [weak self] event in
47-
self?.collectionView(event.0, observedPartialUpdateEvent: event.1)
47+
self?.collectionView(event.0, throttledObservedEvent: event.1)
4848
})
4949
.addDisposableTo(disposeBag)
5050
}
5151

52-
public func collectionView(_ collectionView: UICollectionView, observedPartialUpdateEvent: Event<Element>) {
52+
/**
53+
This method exists because collection view updates are throttled because of internal collection view bugs.
54+
Collection view behaves poorly during fast updates, so this should remedy those issues.
55+
*/
56+
open func collectionView(_ collectionView: UICollectionView, throttledObservedEvent event: Event<Element>) {
5357
UIBindingObserver(UIElement: self) { dataSource, newSections in
5458
let oldSections = dataSource.sectionModels
5559
do {
@@ -69,10 +73,10 @@ public class RxCollectionViewSectionedAnimatedDataSource<S: AnimatableSectionMod
6973
self.setSections(newSections)
7074
collectionView.reloadData()
7175
}
72-
}.on(observedPartialUpdateEvent)
76+
}.on(event)
7377
}
7478

75-
public func collectionView(_ collectionView: UICollectionView, observedEvent: Event<Element>) {
79+
open func collectionView(_ collectionView: UICollectionView, observedEvent: Event<Element>) {
7680
UIBindingObserver(UIElement: self) { dataSource, newSections in
7781
#if DEBUG
7882
self._dataSourceBound = true

Sources/DataSources+Rx/RxCollectionViewSectionedReloadDataSource.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import RxSwift
1313
import RxCocoa
1414
#endif
1515

16-
public class RxCollectionViewSectionedReloadDataSource<S: SectionModelType>
16+
open class RxCollectionViewSectionedReloadDataSource<S: SectionModelType>
1717
: CollectionViewSectionedDataSource<S>
1818
, RxCollectionViewDataSourceType {
1919

@@ -23,7 +23,7 @@ public class RxCollectionViewSectionedReloadDataSource<S: SectionModelType>
2323
super.init()
2424
}
2525

26-
public func collectionView(_ collectionView: UICollectionView, observedEvent: Event<Element>) {
26+
open func collectionView(_ collectionView: UICollectionView, observedEvent: Event<Element>) {
2727
UIBindingObserver(UIElement: self) { dataSource, element in
2828
#if DEBUG
2929
self._dataSourceBound = true

Sources/DataSources+Rx/RxTableViewSectionedAnimatedDataSource.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import RxSwift
1313
import RxCocoa
1414
#endif
1515

16-
public class RxTableViewSectionedAnimatedDataSource<S: AnimatableSectionModelType>
16+
open class RxTableViewSectionedAnimatedDataSource<S: AnimatableSectionModelType>
1717
: TableViewSectionedDataSource<S>
1818
, RxTableViewDataSourceType {
1919

@@ -26,7 +26,7 @@ public class RxTableViewSectionedAnimatedDataSource<S: AnimatableSectionModelTyp
2626
super.init()
2727
}
2828

29-
public func tableView(_ tableView: UITableView, observedEvent: Event<Element>) {
29+
open func tableView(_ tableView: UITableView, observedEvent: Event<Element>) {
3030
UIBindingObserver(UIElement: self) { dataSource, newSections in
3131
#if DEBUG
3232
self._dataSourceBound = true

0 commit comments

Comments
 (0)