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
  • 314,917
  • 42
  • 532
  • 579
Eliko
  • 1,137
  • 4
  • 16
  • 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,302
  • 2
  • 30
  • 43
2
    self.tableView.tableFooterView = UIView(frame: CGRectZero)
Nishant
  • 12,529
  • 9
  • 59
  • 94