Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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];
    }
}
like image 599
collinhaines Avatar asked Oct 20 '22 04:10

collinhaines


1 Answers

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

like image 107
Keenle Avatar answered Nov 04 '22 21:11

Keenle