Skip to content

Commit

Permalink
Release 1.0.0-rc.2
Browse files Browse the repository at this point in the history
  • Loading branch information
kzaher committed Oct 19, 2016
1 parent 2a0a3e8 commit 68556d3
Show file tree
Hide file tree
Showing 14 changed files with 147 additions and 216 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file.

---

## [1.0.0-rc.2](https://github.com/RxSwiftCommunity/RxDataSources/releases/tag/1.0.0-rc.2)

#### Features

* Makes rest of data source classes and methods open.
* Small polish for UI.
* Removes part of deprecated extensions.

## [1.0.0-rc.1](https://github.com/RxSwiftCommunity/RxDataSources/releases/tag/1.0.0-rc.1)

#### Features
Expand Down
130 changes: 57 additions & 73 deletions Example/Base.lproj/Main.storyboard

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions Example/Example2_RandomizedSectionsAnimation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@ extension ViewController {
// MARK: Initial value

func initialValue() -> [NumberSection] {
let generate = true
if generate {

#if true
let nSections = 10
let nItems = 100

Expand All @@ -133,10 +131,9 @@ extension ViewController {
return (0 ..< nSections).map { (i: Int) in
NumberSection(header: "Section \(i + 1)", numbers: $(Array(i * nItems ..< (i + 1) * nItems)), updated: Date())
}
}
else {
#else
return _initialValue
}
#endif
}


Expand Down
2 changes: 1 addition & 1 deletion Example/Example4_DifferentSectionAndItemTypes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class MultipleSectionModelViewController: UIViewController {
}

dataSource.titleForHeaderInSection = { dataSource, index in
let section = dataSource.sectionAtIndex(index)
let section = dataSource[index]

return section.title
}
Expand Down
2 changes: 1 addition & 1 deletion Example/Support/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
Expand Down
2 changes: 1 addition & 1 deletion RxDataSources.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "RxDataSources"
s.version = "1.0.0-rc.1"
s.version = "1.0.0-rc.2"
s.summary = "This is a collection of reactive data sources for UITableView and UICollectionView."
s.description = <<-DESC
This is a collection of reactive data sources for UITableView and UICollectionView.
Expand Down
8 changes: 0 additions & 8 deletions RxDataSources.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
9FCDA1751C3AF4A2000F5F94 /* RxCollectionViewSectionedReloadDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85EE5531C36F1FC0090614D /* RxCollectionViewSectionedReloadDataSource.swift */; };
9FCDA1761C3AF4A2000F5F94 /* RxTableViewSectionedAnimatedDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85EE5541C36F1FC0090614D /* RxTableViewSectionedAnimatedDataSource.swift */; };
9FCDA1771C3AF4A2000F5F94 /* RxTableViewSectionedReloadDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85EE5551C36F1FC0090614D /* RxTableViewSectionedReloadDataSource.swift */; };
9FCDA1781C3AF4A2000F5F94 /* UISectionedViewType+RxAnimatedDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85EE5561C36F1FC0090614D /* UISectionedViewType+RxAnimatedDataSource.swift */; };
9FF3014A1C4AA6D1007376BD /* RxCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FF301481C4AA6D1007376BD /* RxCocoa.framework */; };
9FF3014B1C4AA6D1007376BD /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FF301491C4AA6D1007376BD /* RxSwift.framework */; };
9FF3014E1C4AA6DA007376BD /* RxCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FF3014C1C4AA6DA007376BD /* RxCocoa.framework */; };
Expand All @@ -56,7 +55,6 @@
C85EE5611C36F1FC0090614D /* RxCollectionViewSectionedReloadDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85EE5531C36F1FC0090614D /* RxCollectionViewSectionedReloadDataSource.swift */; };
C85EE5621C36F1FC0090614D /* RxTableViewSectionedAnimatedDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85EE5541C36F1FC0090614D /* RxTableViewSectionedAnimatedDataSource.swift */; };
C85EE5631C36F1FC0090614D /* RxTableViewSectionedReloadDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85EE5551C36F1FC0090614D /* RxTableViewSectionedReloadDataSource.swift */; };
C85EE5641C36F1FC0090614D /* UISectionedViewType+RxAnimatedDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85EE5561C36F1FC0090614D /* UISectionedViewType+RxAnimatedDataSource.swift */; };
C87DF3461D0219A7006308C5 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C87DF3431D0219A7006308C5 /* AppDelegate.swift */; };
C87DF3471D0219A7006308C5 /* NumberSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = C87DF3441D0219A7006308C5 /* NumberSection.swift */; };
C87DF3481D0219A7006308C5 /* Randomizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = C87DF3451D0219A7006308C5 /* Randomizer.swift */; };
Expand Down Expand Up @@ -103,7 +101,6 @@
C8BB76661C4C3E53002B21C8 /* SectionModelType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85EE54E1C36F1FC0090614D /* SectionModelType.swift */; };
C8BB76671C4C3E53002B21C8 /* AnimatableSectionModelType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8BB76241C4C3CDF002B21C8 /* AnimatableSectionModelType.swift */; };
C8BB76691C4C3E53002B21C8 /* Differentiator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85EE54B1C36F1FC0090614D /* Differentiator.swift */; };
C8BB766A1C4C3E53002B21C8 /* UISectionedViewType+RxAnimatedDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85EE5561C36F1FC0090614D /* UISectionedViewType+RxAnimatedDataSource.swift */; };
C8BB766C1C4C3E53002B21C8 /* RxTableViewSectionedReloadDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85EE5551C36F1FC0090614D /* RxTableViewSectionedReloadDataSource.swift */; };
C8BB766D1C4C3E53002B21C8 /* CollectionViewSectionedDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85EE5491C36F1FC0090614D /* CollectionViewSectionedDataSource.swift */; };
C8BB766E1C4C3E53002B21C8 /* TableViewSectionedDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85EE54F1C36F1FC0090614D /* TableViewSectionedDataSource.swift */; };
Expand Down Expand Up @@ -212,7 +209,6 @@
C85EE5531C36F1FC0090614D /* RxCollectionViewSectionedReloadDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxCollectionViewSectionedReloadDataSource.swift; sourceTree = "<group>"; };
C85EE5541C36F1FC0090614D /* RxTableViewSectionedAnimatedDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxTableViewSectionedAnimatedDataSource.swift; sourceTree = "<group>"; };
C85EE5551C36F1FC0090614D /* RxTableViewSectionedReloadDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxTableViewSectionedReloadDataSource.swift; sourceTree = "<group>"; };
C85EE5561C36F1FC0090614D /* UISectionedViewType+RxAnimatedDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UISectionedViewType+RxAnimatedDataSource.swift"; sourceTree = "<group>"; };
C87DF3431D0219A7006308C5 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
C87DF3441D0219A7006308C5 /* NumberSection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NumberSection.swift; sourceTree = "<group>"; };
C87DF3451D0219A7006308C5 /* Randomizer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Randomizer.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -403,7 +399,6 @@
C85EE5531C36F1FC0090614D /* RxCollectionViewSectionedReloadDataSource.swift */,
C85EE5541C36F1FC0090614D /* RxTableViewSectionedAnimatedDataSource.swift */,
C85EE5551C36F1FC0090614D /* RxTableViewSectionedReloadDataSource.swift */,
C85EE5561C36F1FC0090614D /* UISectionedViewType+RxAnimatedDataSource.swift */,
);
path = "DataSources+Rx";
sourceTree = "<group>";
Expand Down Expand Up @@ -819,7 +814,6 @@
9FCDA1711C3AF4A2000F5F94 /* SectionModelType.swift in Sources */,
C8BB762F1C4C3CDF002B21C8 /* AnimatableSectionModelType.swift in Sources */,
9FCDA16E1C3AF4A2000F5F94 /* Differentiator.swift in Sources */,
9FCDA1781C3AF4A2000F5F94 /* UISectionedViewType+RxAnimatedDataSource.swift in Sources */,
C8477FBB1D29DBC90074454A /* IntegerType+IdentifiableType.swift in Sources */,
9FCDA1771C3AF4A2000F5F94 /* RxTableViewSectionedReloadDataSource.swift in Sources */,
9FCDA16C1C3AF4A2000F5F94 /* CollectionViewSectionedDataSource.swift in Sources */,
Expand Down Expand Up @@ -851,7 +845,6 @@
C85EE55D1C36F1FC0090614D /* SectionModelType.swift in Sources */,
C8BB762E1C4C3CDF002B21C8 /* AnimatableSectionModelType.swift in Sources */,
C85EE55A1C36F1FC0090614D /* Differentiator.swift in Sources */,
C85EE5641C36F1FC0090614D /* UISectionedViewType+RxAnimatedDataSource.swift in Sources */,
C8477FBA1D29DBC90074454A /* IntegerType+IdentifiableType.swift in Sources */,
C85EE5631C36F1FC0090614D /* RxTableViewSectionedReloadDataSource.swift in Sources */,
C85EE5581C36F1FC0090614D /* CollectionViewSectionedDataSource.swift in Sources */,
Expand Down Expand Up @@ -927,7 +920,6 @@
C8BB76661C4C3E53002B21C8 /* SectionModelType.swift in Sources */,
C8BB76671C4C3E53002B21C8 /* AnimatableSectionModelType.swift in Sources */,
C8BB76691C4C3E53002B21C8 /* Differentiator.swift in Sources */,
C8BB766A1C4C3E53002B21C8 /* UISectionedViewType+RxAnimatedDataSource.swift in Sources */,
C8477FB91D29DBC90074454A /* IntegerType+IdentifiableType.swift in Sources */,
C8BB766C1C4C3E53002B21C8 /* RxTableViewSectionedReloadDataSource.swift in Sources */,
C8BB766D1C4C3E53002B21C8 /* CollectionViewSectionedDataSource.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import RxCocoa
This is commented becuse collection view has bugs when doing animated updates.
Take a look at randomized sections.
*/
public class RxCollectionViewSectionedAnimatedDataSource<S: AnimatableSectionModelType>
open class RxCollectionViewSectionedAnimatedDataSource<S: AnimatableSectionModelType>
: CollectionViewSectionedDataSource<S>
, RxCollectionViewDataSourceType {
public typealias Element = [S]
Expand All @@ -44,12 +44,16 @@ public class RxCollectionViewSectionedAnimatedDataSource<S: AnimatableSectionMod
// help to alleviate the issues with them.
.throttle(0.5, scheduler: MainScheduler.instance)
.subscribe(onNext: { [weak self] event in
self?.collectionView(event.0, observedPartialUpdateEvent: event.1)
self?.collectionView(event.0, throttledObservedEvent: event.1)
})
.addDisposableTo(disposeBag)
}

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

public func collectionView(_ collectionView: UICollectionView, observedEvent: Event<Element>) {
open func collectionView(_ collectionView: UICollectionView, observedEvent: Event<Element>) {
UIBindingObserver(UIElement: self) { dataSource, newSections in
#if DEBUG
self._dataSourceBound = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import RxSwift
import RxCocoa
#endif

public class RxCollectionViewSectionedReloadDataSource<S: SectionModelType>
open class RxCollectionViewSectionedReloadDataSource<S: SectionModelType>
: CollectionViewSectionedDataSource<S>
, RxCollectionViewDataSourceType {

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

public func collectionView(_ collectionView: UICollectionView, observedEvent: Event<Element>) {
open func collectionView(_ collectionView: UICollectionView, observedEvent: Event<Element>) {
UIBindingObserver(UIElement: self) { dataSource, element in
#if DEBUG
self._dataSourceBound = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import RxSwift
import RxCocoa
#endif

public class RxTableViewSectionedAnimatedDataSource<S: AnimatableSectionModelType>
open class RxTableViewSectionedAnimatedDataSource<S: AnimatableSectionModelType>
: TableViewSectionedDataSource<S>
, RxTableViewDataSourceType {

Expand All @@ -26,7 +26,7 @@ public class RxTableViewSectionedAnimatedDataSource<S: AnimatableSectionModelTyp
super.init()
}

public func tableView(_ tableView: UITableView, observedEvent: Event<Element>) {
open func tableView(_ tableView: UITableView, observedEvent: Event<Element>) {
UIBindingObserver(UIElement: self) { dataSource, newSections in
#if DEBUG
self._dataSourceBound = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import RxSwift
import RxCocoa
#endif

public class RxTableViewSectionedReloadDataSource<S: SectionModelType>
open class RxTableViewSectionedReloadDataSource<S: SectionModelType>
: TableViewSectionedDataSource<S>
, RxTableViewDataSourceType {
public typealias Element = [S]
Expand All @@ -22,7 +22,7 @@ public class RxTableViewSectionedReloadDataSource<S: SectionModelType>
super.init()
}

public func tableView(_ tableView: UITableView, observedEvent: Event<Element>) {
open func tableView(_ tableView: UITableView, observedEvent: Event<Element>) {
UIBindingObserver(UIElement: self) { dataSource, element in
#if DEBUG
self._dataSourceBound = true
Expand Down

This file was deleted.

Loading

0 comments on commit 68556d3

Please sign in to comment.