'iOS 15 - UIButtons checking themselves due to tableView.reloadData()

With the recent changes requiring builds to be done on xcode 13, we have run into a problem where on iOS 15 ONLY, UIButtons are checking themselves. In this particular situation, we have a button that, when "Yes" is clicked, a drop box appears below the question and indexes as such. Currently, the way this is written has tableView.reloadData() which allows the text box to appear. In iOS 14 and below, this causes no additional issues. In iOS15, when clicking the "Yes" or "No" button on the first question, the question directly below is also lights up. In other parts of the app, I could simply remove this for iOS15 and it worked just fine but due to the requirement for making the text box appear, this one wont allow for this. Has anyone seen this type of specific iOS15 behaviour yet?

See code here for the Reload

  func didAnswerExpansionQuestion(itemKey: String, answer: Int) {
var indexToAdjust = -1

for (index, question) in questionsArray.enumerated() {
  if question["expansionItem"] != nil && question["expansionItem"] as! String == itemKey {
    indexToAdjust = index
      print (questionsArray.count)
  }
}

adjustCells(itemIndex: indexToAdjust, key: itemKey, answer: answer)
cmhReferralTableView.reloadData()

}

buttons and text dropdown image



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source