By default there is a single line separator in uitableview.
But I want to put my customized line as a separator.
Is it possible? How?
Swift version:
private let kSeparatorTag = 123
private let kSeparatorHeight: CGFloat = 1.5
func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath)
{
if cell.viewWithTag(kSeparatorTag) == nil //add separator only once
{
let separatorView = UIView(frame: CGRectMake(0, cell.frame.height - kSeparatorHeight, cell.frame.width, kSeparatorHeight))
separatorView.tag = kSeparatorId
separatorView.backgroundColor = UIColor.redColor()
separatorView.autoresizingMask = [.FlexibleWidth, .FlexibleHeight]
cell.addSubview(separatorView)
}
}