To clarify this problem, it is about a default UIViewController with a UICollectionView inside of it (not a UICollectionViewController). This view controller is set as the result view controller of a UISearchViewController and that is wrapped in a UISearchContainerViewController and that is wrapped in a UINavigationController like explained in this forum to make it work (if i leave any out the view will simply not appear)
Setup code
_searchResultsViewController = [[SearchResultsViewController alloc] init];
[_searchResultsViewController setDelegate:self];
_searchViewController = [[UISearchController alloc] initWithSearchResultsController:_searchResultsViewController];
[_searchViewController setSearchResultsUpdater:_searchResultsViewController];
_searchContainerViewController = [[UISearchContainerViewController alloc] initWithSearchController: _searchViewController];
[_searchContainerViewController setTitle:CRLocalizedString(@"Search")];
_searchNavigationController = [[UINavigationController alloc] initWithRootViewController:_searchContainerViewController];
}
When we scroll in the UICollectionView while staying on the first row the search bar stays completly visible.
If we scroll down to the second row the search bar scrolls up, due to this the keyboard also moves up, the searchbar is now completly hidden and the keyboard is still visible on the top