कस्टम रंग जोड़ने के लिए नीचे दिए गए कोड का उपयोग करें। और इसे पारदर्शी उपयोग करने के लिएalpha: 0.0
cell.selectedBackgroundView = UIView(frame: CGRect.zero)
cell.selectedBackgroundView?.backgroundColor = UIColor(red:0.27, green:0.71, blue:0.73, alpha:1.0)
यदि आप कस्टम रंग का उपयोग करते हैं और इसे गोल कोने का उपयोग देना चाहते हैं:
cell.layer.cornerRadius = 8
इसके अलावा, बेहतर एनीमेशन और फील के लिए इसका इस्तेमाल करें
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;इसे अपनीcellForRowAtIndexPathविधि में जोड़ें