As part of my study to understand UIKit deeply and how its functions are implemented, I was reading that in the early years of iOS, UITableView loaded every cell in the table view, but after what they do was that now loads just cells that are visible. So how could the dequeueReusableCell(withIdentifier identifier:String) be implemented?
class UITableView: UIScrollView {
func dequeueReusableCell(withIdentifier identifier: String) -> UITableViewCell? {
}
}
What I think is that there's an array that holds visible cells and that methods just filters according to the identifier. Something like this:
let cell = visibleCells.filter { $0.identifier == identifier }
return cell
But I want to know if there could be a better way to understand it and do it.