1
votes

I have a UISearchBar as a subview of a UIViewController's view. The UIViewController has a navigation bar. When I touch on the UISearchBar, I initiate an animation that moves the navigation bar up and off of the screen and move the search bar up to be in place of the navigation bar.

When I do this, the cancel button belonging to the search bar does not send touch events to the search bar's delegate. When I move the search bar up a few pixels, the search bar cancel button still works.

Any suggestions on what I might be doing wrong?

1

1 Answers

2
votes

How do you get the touch events (UIGestureRecognizers?)? Are you sure the UISearchBar is not behind any other view (maybe with a transparent background)? This might cause that your touch events are sent to this overlaying view. Also possible issue might be you moved the UISearchBar out its super view. Check by giving its super view some backgroundColor.