Stephen Fox Stephen Fox - 1 year ago 116
iOS Question

How to remove extra empty cells in TableViewController, iOS - Swift

Hi I have a

with two static cells, however when displayed, it shows the two static cells, and then all the other empty cells for the tableview. However I don't want to display those cells as they are useless. How do I hide the rest of the cells apart from the two static cell?

Answer Source

in your viewDidLoad() function add this line of code:

tableView.tableFooterView = UIView()
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download