WWDC 14 – Presentation Controllers – V228

New in iOS8

new “AlertViews” and “ActionSheets” are presented using UIAlertController

UIAlertController *sheet = [UIAlertController alertControllerWithTitle:...];
[sheet addAction:[UIAlertAction actionWithtTitle:@"Reply"
style:UIAlertActionStyleDefault handler:^void (UIAlertAction *action){

}];

[self presentViewController:sheet ...];

New UISearchController

MyResultsController *resultsController = [[MyResultsController alloc] init];

UISearchController *searchController = [[UISearchController alloc] initWithSearchResultsController:resultsController];
searchController.searchResultsUpdater = resultsController;
self.tableView.tableHeaderView = searchController.searchBar;
self.definesPresentationContext = YES

self.definesPresentationContext
Tells the searchController where to present the resultsController. If this one is not defined, it searches the next closest parent controller that is defined as presentation context. In case no one is found, it uses the rootViewController

Leave a Reply

Your email address will not be published. Required fields are marked *