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
    }
1

1 Answer 1

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
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.