How to animate a UISearchBar sliding in and out of the view without a UISearchDisplayController?

691 views Asked by At

I have a view that has a button which toggles a UISearchBar using

searchBar.hidden = !searchBar.hidden;

The searchbar goes out and queries a web service to get results and then displays them to the user without ever using a UITableView or a local datasource or anything. As such I don't really want to use a UISearchDisplayController to do the animation.

Is there anyway to animate this sliding without manually coding up the animation?

Thanks!

1

There are 1 answers

0
NSResponder On

Go ahead and use the UISearchDisplayController. It's not a terribly heavyweight object. Any code you write to replace its functionality is certainly going to have a bigger footprint than an instance of a class you've already got in the UIKit.