0

I am writing a phone-like app with a custom numeric keypad. I would like to search through my contacts for name/phone number as I type on the numeric keypad and displaying the results in a small tableview above the numeric keypad. I therefore would like to do this without using the standard UISearchBar, since the typed in phone number will be displayed in a toolbar, similar to the built-in phone app. This means that at no time will a textfiels/uisearchbar get to be the responder.

Is there some way of using UISearchBarDelegate without using UISearchBar?

Piotr Sobiegraj
  • 1,775
  • 16
  • 26
Chuckels5584
  • 551
  • 2
  • 6
  • 17

2 Answers2

0

A UISearchBarDelegate isn't going to work well for you because many of the delegate methods specify that the caller will pass in a UISearchBar. You could certainly define your own delegate protocol with similar methods, but using the class of your "custom numeric keypad" instead.

Since you would be implementing the delegate in either case, there's not much saving in using the predefined protocol.

Phillip Mills
  • 30,888
  • 4
  • 42
  • 57
0

I have been trying the same. Finally, I set the searchbar hidden [mySearchBar setHidden:YES] and the height size to 0.1, making the app practically without a searchbar, but still functionall.

Tom Tallak Solbu
  • 559
  • 6
  • 20