diff --git a/RxExample/RxDataSources/DataSources/DataSources.swift b/RxExample/RxDataSources/DataSources/DataSources.swift index 0d560711..7a7c7253 100644 --- a/RxExample/RxDataSources/DataSources/DataSources.swift +++ b/RxExample/RxDataSources/DataSources/DataSources.swift @@ -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)") } diff --git a/RxExample/RxDataSources/DataSources/Differentiator.swift b/RxExample/RxDataSources/DataSources/Differentiator.swift index 79e33bb5..9dcf13df 100644 --- a/RxExample/RxDataSources/DataSources/Differentiator.swift +++ b/RxExample/RxDataSources/DataSources/Differentiator.swift @@ -9,7 +9,7 @@ import Foundation public enum DifferentiatorError - : Swift.Error + : Error , CustomDebugStringConvertible { case duplicateItem(item: Any) case duplicateSection(section: Any) diff --git a/RxExample/RxDataSources/DataSources/TableViewSectionedDataSource.swift b/RxExample/RxDataSources/DataSources/TableViewSectionedDataSource.swift index 29829182..856dfd2b 100644 --- a/RxExample/RxDataSources/DataSources/TableViewSectionedDataSource.swift +++ b/RxExample/RxDataSources/DataSources/TableViewSectionedDataSource.swift @@ -72,7 +72,8 @@ public class _TableViewSectionedDataSource public func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool { return _rx_tableView(tableView, canMoveRowAtIndexPath: indexPath) } - + + #if os(iOS) func _sectionIndexTitlesForTableView(_ tableView: UITableView) -> [String]? { return nil } @@ -80,7 +81,7 @@ public class _TableViewSectionedDataSource public func sectionIndexTitles(for tableView: UITableView) -> [String]? { return _sectionIndexTitlesForTableView(tableView) } - + func _rx_tableView(_ tableView: UITableView, sectionForSectionIndexTitle title: String, atIndex index: Int) -> Int { return 0 } @@ -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 public var rowAnimation: UITableViewRowAnimation = .automatic + #if os(iOS) public var sectionIndexTitles: ((RxTableViewSectionedDataSource) -> [String]?)? { didSet { #if DEBUG @@ -209,6 +212,7 @@ public class RxTableViewSectionedDataSource #endif } } + #endif public override init() { super.init() @@ -264,7 +268,8 @@ public class RxTableViewSectionedDataSource override func _rx_tableView(_ tableView: UITableView, moveRowAtIndexPath sourceIndexPath: IndexPath, toIndexPath destinationIndexPath: IndexPath) { 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 return section } - + #endif }