Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Hi I have a TableViewController 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?

like image 381
Stephen Fox Avatar asked Feb 24 '15 23:02

Stephen Fox


1 Answers

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

tableView.tableFooterView = UIView() 
like image 147
HorseT Avatar answered Nov 16 '22 00:11

HorseT