Files
RxSwift/RxExample/RxDataSources/DataSources+Rx/RxTableViewSectionedReloadDataSource.swift
sergdort cfb8b1558a Merge branch 'master' into swift-3.0
Conflicts:
	RxExample/RxDataSources/DataSources/CollectionViewSectionedDataSource.swift
	RxExample/RxDataSources/DataSources/Differentiator.swift
	RxExample/RxDataSources/DataSources/TableViewSectionedDataSource.swift
	RxExample/RxExample.xcodeproj/project.pbxproj
	RxExample/RxExample.xcodeproj/xcshareddata/xcschemes/RxExample-iOS-no-module.xcscheme
	RxExample/RxExample/Examples/TableViewPartialUpdates/PartialUpdatesViewController.swift
	RxExample/RxExample/Examples/TableViewWithEditingCommands/TableViewWithEditingCommandsViewController.swift
	RxExample/RxExample/Services/HtmlParsing.swift
	Tests/RxCocoaTests/CLLocationManager+RxTests.swift
	Tests/RxCocoaTests/UICollectionView+RxTests.swift
2016-07-05 18:00:36 +03:00

35 lines
853 B
Swift

//
// RxTableViewSectionedReloadDataSource.swift
// RxExample
//
// Created by Krunoslav Zaher on 6/27/15.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
import Foundation
import UIKit
#if !RX_NO_MODULE
import RxSwift
import RxCocoa
#endif
public class RxTableViewSectionedReloadDataSource<S: SectionModelType>
: RxTableViewSectionedDataSource<S>
, RxTableViewDataSourceType {
public typealias Element = [S]
public override init() {
super.init()
}
public func tableView(_ tableView: UITableView, observedEvent: Event<Element>) {
UIBindingObserver(UIElement: self) { dataSource, element in
#if DEBUG
self._dataSourceBound = true
#endif
dataSource.setSections(element)
tableView.reloadData()
}.on(observedEvent)
}
}