Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

uitableview set space between cells

// 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
}
 
PREVIOUS NEXT
Tagged: #uitableview #set #space #cells
ADD COMMENT
Topic
Name
4+4 =