Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/93.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 在Bond5 tableview/collectionview绑定中传递代理数据源_Ios_Swift3_Reactivekit - Fatal编程技术网

Ios 在Bond5 tableview/collectionview绑定中传递代理数据源

Ios 在Bond5 tableview/collectionview绑定中传递代理数据源,ios,swift3,reactivekit,Ios,Swift3,Reactivekit,使用Bond 4.x可以在将tableview绑定到ObservableArray时传递我的自定义数据源,以便实现UICollectionViewDataSource方法的自定义调用(例如ViewForSupplmentalElementOfKind),如下所示: viewModel.dataSource.bindTo(collectionView, proxyDataSource: HeaderViewCreator()) { indexPath, dataSource, tableView

使用
Bond 4.x
可以在将tableview绑定到
ObservableArray
时传递我的自定义数据源,以便实现UICollectionViewDataSource方法的自定义调用(例如
ViewForSupplmentalElementOfKind
),如下所示:

viewModel.dataSource.bindTo(collectionView, proxyDataSource: HeaderViewCreator()) { indexPath, dataSource, tableView
这一点现在在Bond5中消失了,因为尝试使用
proxyDataSource
参数会导致编译器错误,要求在调用中使用不同的参数标签

不幸的是,我在迁移指南中找不到合适的部分,而且我很难理解这方面的文档
BNDTableViewProxyDataSource
和朋友们似乎完全脱离了代码库


谢谢你的帮助

UITableView和UICollectionView现在具有类型为
ProtocolProxy
的属性
bnd_委托
bnd_数据源
。该类型有一个属性
forwardTo
,您可以将该属性设置为接收ProtocolProxy(即Bond)未使用的委托或数据源回调

例如:

class MyViewController: UITableViewDelegate {

  var tableView: UITableView

  func viewDidLoad() {
    super.viewDidLoad()
    tableView.bnd_delegate.forwardTo = self
  }
}

完美的非常感谢。