Skip to content

Commit

Permalink
Remove unneeded UIScrollVIew delegates
Browse files Browse the repository at this point in the history
The delegates were implemented to implement a workaround for UISearchDisplayController under iOS7. This is not effective anymore and can be removed.
  • Loading branch information
wutschel committed Dec 18, 2021
1 parent 35f000c commit 2ceb07a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 50 deletions.
1 change: 0 additions & 1 deletion XBMC Remote/DetailViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@
CGFloat iOSYDelta;
__weak IBOutlet UIToolbar *buttonsViewBgToolbar;
BOOL isViewDidLoad;
BOOL hideSearchBarActive;
BOOL forceMusicAlbumMode;
NSMutableDictionary *epgDict;
NSMutableArray *epgDownloadQueue;
Expand Down
49 changes: 0 additions & 49 deletions XBMC Remote/DetailViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -2858,55 +2858,6 @@ - (CGFloat)tableView:(UITableView*)tableView heightForFooterInSection:(NSInteger
return 0;
}

#pragma mark - ScrollView Delegate

- (void)scrollViewDidScrollToTop:(UIScrollView*)scrollView {
if (enableCollectionView) { // temp hack to avoid the iOS7 search bar disappearing!!!
[self.searchController.searchBar removeFromSuperview];
[activeLayoutView addSubview:self.searchController.searchBar];
}
}

- (void)scrollViewWillBeginDragging:(UIScrollView*)scrollView {
hideSearchBarActive = YES;
}

- (void)scrollViewDidEndDragging:(UIScrollView*)scrollView willDecelerate:(BOOL)decelerate {
if (!decelerate) {
hideSearchBarActive = NO;
}
}

- (void)scrollViewDidEndDecelerating:(UIScrollView*)scrollView {
hideSearchBarActive = NO;
}

// iOS7 scrolling performance boost for a UITableView/UICollectionView with a custom UISearchBar header
- (void)scrollViewDidScroll:(UIScrollView*)scrollView {
if (!hideSearchBarActive || [self doesShowSearchResults]) {
return;
}
NSArray *paths;
NSIndexPath *searchBarPath;
NSInteger sectionNumber = self.sections.count > 1 ? 1 : 0;
if (self.richResults.count) {
if ([scrollView isEqual:dataList]) {
paths = [dataList indexPathsForVisibleRows];
searchBarPath = [NSIndexPath indexPathForRow:0 inSection:sectionNumber];
}
else if ([scrollView isEqual:collectionView]) {
paths = [collectionView indexPathsForVisibleItems];
searchBarPath = [NSIndexPath indexPathForItem:0 inSection:sectionNumber];
}
if ([paths containsObject:searchBarPath]) {
if (enableCollectionView) { // temp hack to avoid the iOS7 search bar disappearing!!!
[self.searchController.searchBar removeFromSuperview];
[activeLayoutView addSubview:self.searchController.searchBar];
}
}
}
}

#pragma mark - Content Filtering

- (UIImageView*)findHairlineImageViewUnder:(UIView*)view {
Expand Down

0 comments on commit 2ceb07a

Please sign in to comment.