Как реализовать динамический UItableview внутри динамического UITableviewcell в Swift? - PullRequest
0 голосов
/ 25 мая 2019

Я реализовал динамический UITableView внутри UITableViewCell.Но заполняется только первое значение массива.Остальные значения не заполняются.

Я использую следующий код в UIViewController:

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    if (self.myorderList[indexPath.row]["status"] as? String == "Order Reccieved") {
        let cell:testTVC = self.myorderTableView.dequeueReusableCell(withIdentifier: "test") as! testTVC
        let storevalue =  self.myorderList[indexPath.row]["stores"] as? [[String : AnyObject]]
        print("the store value is",storevalue)
        cell.listArray(myorderListtest: storevalue!)
        return cell
    }

Я получаю значения из UIViewController в UITableViewCell следующим образом

func listArray(myorderListtest:[[String : AnyObject]]) {
    myorderList = [myorderListtest[0]]
    print("inside tableview cell value is",myorderList)
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    var cell: insideTableViewCell? = tableView.dequeueReusableCell(withIdentifier: "insideTableViewCell") as? insideTableViewCell

    if cell == nil {
        cell = UITableViewCell(style: UITableViewCell.CellStyle.default, reuseIdentifier: "insideTableViewCell") as? insideTableViewCell
    }
    cell!.storenamevalue.text = self.filterarray[indexPath.row]["store_name"] as? String
    return cell!
}

enter image description here

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...