A quick look at the UITableView documentation gives us the indexPathsForVisibleRows and combining it with map gives us the array we need:
tableView.indexPathsForVisibleRows.map{ tableView.headerView(forSection: $0.section) }
map returns the array of our visible headers-in-section.