I'm customizing a UITableView
. I want to hide the line separating on the last cell ... can i do this?
I know I can do tableView.separatorStyle = UITableViewCellStyle.None
but that would affect all the cells of the tableView. I want it to only affect my last cell.
I couldn't hide the separator on a specific cell except using the following workaround
Swift:
Objective-C:
In your UITableViewCell subclass, override layoutSubviews and hide the _UITableViewCellSeparatorView. Works under iOS 10.
In
willdisplaycell
:Try the below code, might help you resolve your problem
works well in iOS 10.2