Я хочу показать другую ячейку при выборе «Другой» ячейки в TableView, используя Swift 4.2 до 5.1 - PullRequest
0 голосов
/ 24 октября 2019
   func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {



    let tblContent = tblViewCustomFields[indexPath.row]

    let title = tblContent
    let custmCell = tableView.dequeueReusableCell(withIdentifier: "Cell") as! CustomCellForLetKnowUs

    let customTextCell = tableView.dequeueReusableCell(withIdentifier: "textCell") as! CustomTextCell

    custmCell.lblInfo.text = title
    if indexPath.row == 7 {
        //            cellList.append(.withTxtFld)
        //            tableView.reloadData()
        customTextCell.textView.isHidden = true
    }

    return custmCell

}

1 Ответ

0 голосов
/ 24 октября 2019

Попробуйте сделать это

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
     if indexPath.row == 7 { 
          let customTextCell = tableView.dequeueReusableCell(withIdentifier: "textCell") as! CustomTextCell
          customTextCell.textView.isHidden = true
          return customTextCell
     }


     let custmCell = tableView.dequeueReusableCell(withIdentifier: "Cell") as! CustomCellForLetKnowUs
     custmCell.lblInfo.text = tblViewCustomFields[indexPath.row] ?? ""

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