Eliminating Extra Separators Below UITableView

Eliminating Extra Separators Below UITableView

22 May 2024 Stephan Petzl Leave a comment Tech-Help

When setting up a UITableView with a specific number of rows, you might notice extra separator lines or blank cells below the filled rows. This article will guide you on how to remove these extra separators efficiently.

Using Interface Builder (iOS 9+)

For those using Interface Builder, the process is quite simple:

  • Drag a UIView into your UITableView as a footer.
  • In the storyboard, position it below your custom cells. You may prefer to name it “footer”.
  • Set the footer view’s height to zero to ensure it doesn’t affect the layout.

Note: Adjusting the height of the footer can influence how the bottom bounce of the table is handled.

Programmatic Approach

If you prefer to handle this programmatically, here are the steps for Swift and Objective-C:


override func viewDidLoad() {
    self.tableView.tableFooterView = UIView()


- (void)viewDidLoad {
    [super viewDidLoad];
    // This will remove extra separators from tableview
    self.tableView.tableFooterView = [UIView new];

Alternatively, you can set the frame to CGRectZero:

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

Historical Approach in iOS

For older versions of iOS, you can add the following methods to your table view controller:

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    // This will create an "invisible" footer
    return CGFLOAT_MIN;

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
    return [UIView new];

Practical Example

Here’s a practical example of implementing the solution in Swift:

override func viewDidLoad() {
    // Remove extra separators
    tableView.tableFooterView = UIView()


Removing extra separators from a UITableView can be done easily using both Interface Builder and programmatic approaches. By setting a UIView as the tableFooterView, you can ensure a cleaner and more professional look for your table views.

For more detailed guides and advanced techniques, check out our documentation on advanced testing techniques.

Enhance Your Mobile App Testing with Repeato

While eliminating extra separators improves the visual aspect of your UITableView, ensuring your app runs smoothly across various scenarios is crucial. This is where Repeato comes in. Repeato is a no-code test automation tool for iOS and Android that helps you create, run, and maintain automated tests for your apps efficiently.

With Repeato, you can focus on creating a great product instead of spending time on creating and maintaining tests. It’s particularly fast to edit and run tests, leveraging computer vision and AI. Moreover, Repeato allows developers to forward the task of test automation to non-technical colleagues or QAs, streamlining the development process.

Learn more about how Repeato can enhance your mobile app development process by visiting our documentation or download page.

Like this article? there’s more where that came from!