Uitableview Set Space Between Cells

[Solved] Uitableview Set Space Between Cells | Swift - Code Explorer | yomemimo.com
Question : uitableview set space between cells

Answered by : wicked-wolf-kfrr7ktv1iyg

// Replace table rows with sections by extending UITableViewDelegate
// now we use indexPath.section instead of indexPath.row
// set 1 row for each section
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {	return 1
}
// set distance between each table cell
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {	return 16.00
}
// hide header section
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {	let headerView = UIView()	headerView.backgroundColor = UIColor.clear	return headerView
}

Source : | Last Update : Wed, 30 Mar 22

Answers related to uitableview set space between cells

Code Explorer Popular Question For Swift