How to remove the last border of the last cell in UITableView?

ios, iphone, objective-c, uitableview, xcode

Solution

Updated on 9/14/15. My original answer become obsolete, but it is still a universal solution for all iOS versions:

You can hide `tableView`'s standard separator line, and add your custom line at the top of each cell. The easiest way to add custom separator is to add simple `UIView` of 1px height:

UIView* separatorLineView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, cell.bounds.size.width, 1)];
separatorLineView.backgroundColor = [UIColor grayColor];
[cell.contentView addSubview:separatorLineView];

To date, I subscribe to another way for hiding extra separators below cells (works for iOS 6.1+):

self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];

Problem

In my app, I use a `UITableView` My problem is that I want to remove the last border of the last cell in `UITableView`. Please check the following image:

Original source

Related problems