Search code examples
iphoneobjective-ccocoa-touchuiviewuisearchdisplaycontroller

How can I add a UISearchDisplayController to a UIView?


How can I add a UISearchDisplayController to a UIView? Interface builder won't let me.


Solution

  • A UISearchDisplayController cannot be added to a UIView because it doesn't inherit from a UIView. You can add a UISearchBar in Interface builder with an IBOutlet and then create a UISearchDisplayController with that UISearchBar programmatically.