I have taken UITableview section header and other cell to display contents but when it comes to give corner radius how can we achieve such layout with out having any pain.
I have tried to give corner radius to tableview header for from topLeft,topRight and last cell to bottomLeft,bottomRight but it didn't work for me.
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
guard let headerView = tableView.dequeueReusableCell(withIdentifier: "headerCell") as? headerCell else { return UIView() }
headerView.labelTaskName.text = arrayTaskLists[section].first?.outcome_title
headerView.viewContainerHeader.roundCorners([.topRight,.topLeft], radius: 10.0)
headerView.viewContainerHeader.layoutSubviews()
headerView.btnHeaderViewCell.tag = section
headerView.delegate = self
return headerView
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 44
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: CellIdentifier.TaskInformationCell) as! TaskInformationCell
cell.infoView.roundCorners([.bottomLeft,.bottomRight], radius: 10.0)
cell.infoView.layoutSubviews()
}
Thank you for your help.