TableSearch/TableSearch/APLResultsTableController.m

/*
 Copyright (C) 2015 Apple Inc. All Rights Reserved.
 See LICENSE.txt for this sample’s licensing information
 
 Abstract:
 The table view controller responsible for displaying the filtered products as the user types in the search field.
 */
 
#import "APLResultsTableController.h"
#import "APLProduct.h"
 
@implementation APLResultsTableController
 
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.filteredProducts.count;
}
 
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = (UITableViewCell *)[self.tableView dequeueReusableCellWithIdentifier:kCellIdentifier];
    
    APLProduct *product = self.filteredProducts[indexPath.row];
    [self configureCell:cell forProduct:product];
    
    return cell;
}
 
@end