Updating CoreDataTVC

By updating CoreDataTVC to support search, all table views in Grocery Dude will inherit the ability to easily implement search. To add search support to CoreDataTVC, its header will need to be updated to adopt the UISearchBarDelegate and UISearchDisplayDelegate protocols. Listing 12.1 shows how the updated CoreDataTVC header will look once it adopts these search protocols.

Listing 12.1 CoreDataTVC.h

#import <UIKit/UIKit.h>#import "CoreDataHelper.h"@interface CoreDataTVC : UITableViewController<NSFetchedResultsControllerDelegate, UISearchBarDelegate, UISearchDisplayDelegate>@property (strong, nonatomic) NSFetchedResultsController *frc;- (void)performFetch;@end

Update Grocery Dude as follows ...

Get Learning Core Data for iOS: A Hands-On Guide to Building Core Data Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.