diff --git a/Library/JCAutocompletingSearchViewController.m b/Library/JCAutocompletingSearchViewController.m index 40eef1e..d574fac 100644 --- a/Library/JCAutocompletingSearchViewController.m +++ b/Library/JCAutocompletingSearchViewController.m @@ -37,6 +37,14 @@ - (id) initWithCoder:(NSCoder *)aDecoder { - (void) viewDidLoad { [super viewDidLoad]; + + if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) { + // does nothing + } else { + // iOS 7 + + self.searchBar.frame = CGRectMake(0, 0, self.view.frame.size.width, 64); + self.resultsTableView.frame = CGRectMake(0, CGRectGetMaxY(self.searchBar.frame), self.view.frame.size.width, self.view.frame.size.height-self.searchBar.frame.size.width); + } if ( self.delegate && [self.delegate respondsToSelector:@selector(searchControllerShouldPerformBlankSearchOnLoad:)] @@ -242,14 +250,6 @@ - (CGFloat) tableView:(UITableView*)tableView heightForRowAtIndexPath:(NSIndexPa - (void) tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath { NSUInteger row = indexPath.row; - if (self.loading) { - if (row == 0) { - [tableView deselectRowAtIndexPath:indexPath animated:NO]; - return; - } else { - --row; - } - } [self.delegate searchController:self tableView:self.resultsTableView