Вы можете использовать
$0.value // To set default value for PushRow()
Проверьте, есть ли значение, прежде чем установить на $0.value
Вот что я использовал
<<< PushRow<String>(){
$0.tag = String(index)
$0.selectorTitle = checklistFieldNames[index] //
$0.options = ["YES", "NO"]
if question.count == 0{
$0.value = ""
}else {
$0.value = checklistFieldAnswers[0]
}
}.onPresent({ (from, to) in
to.dismissOnChange = false
to.dismissOnSelection = true
to.tableView?.backgroundColor = UIColor(displayP3Red: 244/255, green: 244/255, blue: 244/255, alpha: 1.0)
to.view.backgroundColor = UIColor(displayP3Red: 244/255, green: 244/255, blue: 244/255, alpha: 1.0)
to.selectableRowCellUpdate = { cell, row in
cell.textLabel?.font = UIFont(name: "DTLProkyonT", size: 15)
cell.textLabel?.textColor = UIColor.lightGray
cell.textLabel?.numberOfLines = 0
cell.textLabel?.backgroundColor = UIColor.clear
}
})