0

I have got a toEat array:

var toEat = ["apple"]

In addition, the user can add more fruits to the array while running the app, for example:

var toEat = ["apple", "banana"]

The array has nothing more except apple and banana, so why when I run the app I get empty cells? How can I delete it?

enter image description here

rmaddy
  • 307,833
  • 40
  • 508
  • 550
Eliko
  • 1,083
  • 4
  • 15
  • 26
  • Possible duplicate of [Eliminate Extra separators below UITableView - in iphone sdk?](http://stackoverflow.com/questions/1369831/eliminate-extra-separators-below-uitableview-in-iphone-sdk) – Even if that thread uses Objective-C code (for historical reasons :), the solutions are the same! – Martin R Sep 20 '15 at 10:52

2 Answers2

5

You can try this line of code:

self.tableView.tableFooterView = UIView(frame: CGRectZero)
mkz
  • 2,222
  • 1
  • 27
  • 41
2
    self.tableView.tableFooterView = UIView(frame: CGRectZero)
Nishant
  • 12,375
  • 9
  • 57
  • 91