Updates RxDataSources.

This commit is contained in:
Krunoslav Zaher 2016-08-07 16:12:16 +02:00
parent 10b0d39e05
commit 1b0e0a3c88
3 changed files with 12 additions and 7 deletions

View File

@ -8,7 +8,7 @@
import Foundation
enum RxDataSourceError : Swift.Error {
enum RxDataSourceError : Error {
case unwrappingOptional
case preconditionFailed(message: String)
}
@ -22,7 +22,7 @@ func rxPrecondition(_ condition: Bool, _ message: @autoclosure() -> String) thro
throw RxDataSourceError.preconditionFailed(message: message())
}
func rxDebugFatalError(_ error: Swift.Error) {
func rxDebugFatalError(_ error: Error) {
rxDebugFatalError("\(error)")
}

View File

@ -9,7 +9,7 @@
import Foundation
public enum DifferentiatorError
: Swift.Error
: Error
, CustomDebugStringConvertible {
case duplicateItem(item: Any)
case duplicateSection(section: Any)

View File

@ -73,6 +73,7 @@ public class _TableViewSectionedDataSource
return _rx_tableView(tableView, canMoveRowAtIndexPath: indexPath)
}
#if os(iOS)
func _sectionIndexTitlesForTableView(_ tableView: UITableView) -> [String]? {
return nil
}
@ -88,6 +89,7 @@ public class _TableViewSectionedDataSource
public func tableView(_ tableView: UITableView, sectionForSectionIndexTitle title: String, at index: Int) -> Int {
return _rx_tableView(tableView, sectionForSectionIndexTitle: title, atIndex: index)
}
#endif
func _rx_tableView(_ tableView: UITableView, moveRowAtIndexPath sourceIndexPath: IndexPath, toIndexPath destinationIndexPath: IndexPath) {
}
@ -195,6 +197,7 @@ public class RxTableViewSectionedDataSource<S: SectionModelType>
public var rowAnimation: UITableViewRowAnimation = .automatic
#if os(iOS)
public var sectionIndexTitles: ((RxTableViewSectionedDataSource<S>) -> [String]?)? {
didSet {
#if DEBUG
@ -209,6 +212,7 @@ public class RxTableViewSectionedDataSource<S: SectionModelType>
#endif
}
}
#endif
public override init() {
super.init()
@ -265,6 +269,7 @@ public class RxTableViewSectionedDataSource<S: SectionModelType>
self._sectionModels.moveFromSourceIndexPath(sourceIndexPath, destinationIndexPath: destinationIndexPath)
}
#if os(iOS)
override func _sectionIndexTitlesForTableView(_ tableView: UITableView) -> [String]? {
guard let titles = sectionIndexTitles?(self) else {
return super._sectionIndexTitlesForTableView(tableView)
@ -280,5 +285,5 @@ public class RxTableViewSectionedDataSource<S: SectionModelType>
return section
}
#endif
}