collinhaines
collinhaines

Reputation: 137

UISearchDisplayDelegate Deprecation Work-Around

I noticed that basically everything in UISearchDisplayDelegate is deprecated. Being as how it was the only way I was taught to implement a Search Bar and Search Display Controller, what would be a good work-around?

Sample code being:

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    if (tableView == self.searchDisplayController.searchResultsTableView) { // 'searchDisplayContoller' is now deprecated
        return [searchList count];
    } else {
        return [initialList count];
    }
}

Upvotes: 5

Views: 4790

Answers (1)

Keenle
Keenle

Reputation: 12220

UISearchController should be replacing it...

Class reference: https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UISearchController/index.html

Apple's notes about replacement, scroll to UIKit Framework section: https://developer.apple.com/library/prerelease/ios/releasenotes/General/WhatsNewIniOS/Articles/iOS8.html

Upvotes: 3

Related Questions