mirror of
https://github.com/ReactiveX/RxSwift.git
synced 2024-10-05 06:27:29 +03:00
Merge branch 'develop' into swift-3.0
This commit is contained in:
commit
8b00921da7
@ -280,7 +280,14 @@ extension UICollectionView {
|
||||
-> (source: O)
|
||||
-> Disposable {
|
||||
return { source in
|
||||
|
||||
// This is called for sideeffects only, and to make sure delegate proxy is in place when
|
||||
// data source is being bound.
|
||||
// This is needed because theoretically the data source subscription itself might
|
||||
// call `self.rx_delegate`. If that happens, it might cause weird side effects since
|
||||
// setting data source will set delegate, and UITableView might get into a weird state.
|
||||
// Therefore it's better to set delegate proxy first, just to be sure.
|
||||
_ = self.rx_delegate
|
||||
// Strong reference is needed because data source is in use until result subscription is disposed
|
||||
return source.subscribeProxyDataSource(ofObject: self, dataSource: dataSource, retainDataSource: true) { [weak self] (_: RxCollectionViewDataSourceProxy, event) -> Void in
|
||||
guard let collectionView = self else {
|
||||
return
|
||||
|
@ -287,7 +287,14 @@ extension UITableView {
|
||||
-> (source: O)
|
||||
-> Disposable {
|
||||
return { source in
|
||||
// There needs to be a strong retaining here because
|
||||
// This is called for sideeffects only, and to make sure delegate proxy is in place when
|
||||
// data source is being bound.
|
||||
// This is needed because theoretically the data source subscription itself might
|
||||
// call `self.rx_delegate`. If that happens, it might cause weird side effects since
|
||||
// setting data source will set delegate, and UITableView might get into a weird state.
|
||||
// Therefore it's better to set delegate proxy first, just to be sure.
|
||||
_ = self.rx_delegate
|
||||
// Strong reference is needed because data source is in use until result subscription is disposed
|
||||
return source.subscribeProxyDataSource(ofObject: self, dataSource: dataSource, retainDataSource: true) { [weak self] (_: RxTableViewDataSourceProxy, event) -> Void in
|
||||
guard let tableView = self else {
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user