Eureka自定义Custom PushRow没有价值

时间:2018-08-13 04:22:36

标签: swift uitableview eureka-forms

当我使用静态数据时,一切正常。但是,当我从服务器行加载数据时,无法从选中的单元格中获取值。它向我显示该单元格已检查,但没有返回并显示值。只是保持检查状态

var originalOptions = [ListCheckRow<Row.Cell.Value>]()
var currentOptions = [ListCheckRow<Row.Cell.Value>]()

if query.count >= 3 {
            ClientService.getClientsByRowSearch(searchText: query).done { (clients) in
                self.currentOptions = []
                clients.clients.forEach({ (client) in
                    self.currentOptions.append(self.getCheckRowBy(client: client))
                })
                DispatchQueue.main.async {
                    self.tableView.reloadData()
                }
            }.catch { (e) in
                print(e)
            }

func getCheckRowBy(client: Client) -> ListCheckRow<Row.Cell.Value> {
    let newCheckRow = ListCheckRow<Row.Cell.Value>()
    newCheckRow.baseCell.baseRow.title = client.clientName
    newCheckRow.onCellSelection { (ch1, ch2) in
        ch1.setup()
    }
    return newCheckRow
}

完整代码为here

0 个答案:

没有答案