Wednesday, October 28, 2026
HomeiOS Developmentios - Duplicating UITableViewCells - Stack Overflow

ios – Duplicating UITableViewCells – Stack Overflow

[ad_1]

I’ve a uitableview that reloads its sections. My drawback is, it seems, with each reload, cell sections begin to duplicate and overlap on prime of each other. I added a screenshot of the view hierarchy.

enter image description here

I am unsure if it is associated to dequeueResuableCell as a result of I’m inside every cell part returning a distinct cell class. I added code for instance for part 0 within the cellForRowAt delegate operate.

if x == nil {

            let cell = tableView.dequeueReusableCell(withIdentifier: AReuseIdentifier, for: indexPath) as! AHeaderTableViewCell
            cell.populate()
            return cell
        } else {

            let cell = tableView.dequeueReusableCell(withIdentifier: BReuseIdentifier, for: indexPath) as! BHeaderTableViewCell
            cell.populate()
            return cell
        }

Any ideas could be drastically appreciated.

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments