I am facing the issue of not calling the delegate method when I am trying to reload table view from the tableViewDidSelect method.
if indexPath.row == 0 {
isTermAndConditionExpanded = !isTermAndConditionExpanded
tableView.reloadData()
if isTermAndConditionExpanded {
tableView.scrollToRow(at: IndexPath(row: 1, section: indexPath.section), at: .bottom, animated: true)
} else {
tableView.scrollToRow(at: IndexPath(row: 0, section: indexPath.section), at: .bottom, animated: true)
}
based on isTermAndConditionExpanded I am changing the numberOfRowsinsection. since it is not calling its getting crash. I checked before reloading table view delegate and data source is properly set to present the view controller