1

I am trying to adding space between dynamic cells.

That is my code. I didn't understand why its not working.

 func tableView(tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
        return 50
    }
 func tableView(tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
        let footer = UIView()
        footer.backgroundColor = UIColor.clearColor()
        return footer
    }
Murat Kaya
  • 1,281
  • 3
  • 28
  • 52
  • 2
    Possible duplicate of [spacing between UITableViewCells](http://stackoverflow.com/questions/28598830/spacing-between-uitableviewcells) – Anbu.Karthik Jan 19 '16 at 14:23

1 Answers1

1

You could achieve this by setting your numberOfRows in section to 1 and setting your numberofSections to the array of dynamic items that populate the cells. You could then set the footer view height to your desiered space.

func tableView(tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
    return YOUR_DESIRED_SPACE_BETWEEN_CELLS
}
Devster101
  • 578
  • 4
  • 18