如何在例如:MultipleSelectorRow<T>
上配置所呈现视图的属性?
在Example项目中,这里有一个MultipleSelectorRow
<<< MultipleSelectorRow<Emoji>() {
$0.title = "MultipleSelectorRow"
$0.options = [, , , , , ]
$0.value = [, , ]
}.onPresent { from, to in
to.navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .done, target: from, action: #selector(RowsExampleViewController.multipleSelectorDone(_:)))
}.cellSetup { cell, row in
cell.tintColor = .orange
}
此代码生成一个选择器视图,其中色调是默认值,而不是为Row的单元格本身设置的色调(在本例中为.orange
):
答案 0 :(得分:0)
解决方案是在onPresent
回调中配置显示的VC。可以配置更多的东西,只需要深入到课程中。
只需以与selectableRowCellSetup
[cellSetup][1]
...
.onPresent { from, to in
to.navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .done, target: from, action: #selector(RowsExampleViewController.multipleSelectorDone(_:)))
to.selectableRowCellSetup = { cell, row in
cell.tintColor = .red
}
}
...