Search code examples
iosobjective-cuisearchbaruisearchdisplaycontroller

Using a UISearchDisplayController with UIViewController containment


I have a UICollectionViewController that has a UISearchBar added as a supplementary view, with a UISearchDisplayController attached to it.

The search display controller works as expected, but when the collection view controller is added as a child to another view controller, the animation of the search bar to the navigation bar stops working. I believe this is the correct behaviour since the collection view controller itself doesn't has a navigation bar attached to it.

How can I force the search display controller to use the navigation bar of its parent view and animate to it?


Solution

  • Looks like this is not possible. I ended up giving up on UIViewController containment and adding everything to the same view controller.