Post

Replies

Boosts

Views

Activity

Reply to iOS 15 - UIButtons checking themselves due to tableView.reloadData()
@Claude31 - The dropdown that appears when clicking yes is the details box you see if the screenshot. Below is the cellForRowAt func you were asking for. Let me know if this provides any insights as I am lost entirely as this code has worked for a number of years now on iOS14 and below. func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {       if indexPath.row >= 0 && indexPath.row < referralDestinations.count {    let cell = tableView.dequeueReusableCell(withIdentifier: "MHReferralCell") as? MHReferralCell ?? MHReferralCell(style: .default, reuseIdentifier: "MHReferralCell")    let org = referralDestinations[indexPath.row]    cell.setOrganization(org: org, referral: consentResponses[org.id] ?? ConsentOffered.none, validating: validating)    cell.backgroundColor = UIColor(rgb: 0x3B3F45)    cell.delegate = self    return cell   }   else if indexPath.row == referralDestinations.count {    let cell = tableView.dequeueReusableCell(withIdentifier: "OptionsCell") as? OptionsCell ?? OptionsCell(style: .default, reuseIdentifier: "OptionsCell")    cell.backgroundColor = UIColor(rgb: 0x3B3F45)    cell.addBorders(edges: [.top], color: UIColor(rgb:0x51565E))    cell.setOptions(optionsArray: ["No", "Yes"])         return cell   }   else if indexPath.row == referralDestinations.count + questionsArray.count + 1 {    let cell = tableView.dequeueReusableCell(withIdentifier: "NextCell") as? NextCell ?? NextCell(style: .default, reuseIdentifier: "NextCell")    cell.nextDelegate = self.parent as! QuestionsViewController    cell.currentSection = 4    return cell   }   else {    let question = questionsArray[indexPath.row - (referralDestinations.count + 1)]    if question["type"] as! String != "question" {     let cell = tableView.dequeueReusableCell(withIdentifier: "ExtraDetailsCell") as? ExtraDetailsCell ?? ExtraDetailsCell(style: .default, reuseIdentifier: "ExtraDetailsCell")     cell.detailQuestionKey = question["type"] as? String     cell.delegate = self.parent as! QuestionsViewController     cell.scrollDelegate = self     cell.set(text: delegate?.value(forQuestionKey: cell.detailQuestionKey!))     return cell    }    else {     let cell = tableView.dequeueReusableCell(withIdentifier: "QuestionCell") as? QuestionCell ?? QuestionCell(style: .default, reuseIdentifier: "QuestionCell")     cell.set(questionInformation: question, qDeleate: self.parent as! QuestionsViewController, qcDelegate: self.parent as! QuestionsViewController, validating: validating, showDefinition: showQuestionDefinitions)     cell.extraCellDelegate = self     return cell    }   }      }
May ’22