2

In iOS 7 searchbar delegate method searchBarTextDidBeginEditingis not being called on second time. When i tap first time on searchbar then it is calling searchBarTextDidBeginEditing this method but when i tap second time then it is not calling its delegate method while it is working good in iOS 6. problem is only with iOS 7

Any help please

Mashhadi
  • 3,004
  • 3
  • 46
  • 80

1 Answers1

2

In iOS7 used searchBarShouldBeginEditing and my problem is fixed but still i don't know why it is not calling searchBarTextDidBeginEditing in iOS 7 every time. this is called only once but searchBarShouldBeginEditing is called every time

Elijah
  • 8,381
  • 2
  • 55
  • 49
Mashhadi
  • 3,004
  • 3
  • 46
  • 80
  • 2
    Just a heads up - searchBarTextDidBeginEditing is called only once, while the last active textview/textfield was search view. If you have some other textfield/textview in your view structure, then by selecting that one, and then again search field - it will call this delegate again. But yes, easier is just to switch searchBarTextDidBeginEditing to searchBarShouldBeginEditing. – Guntis Treulands Jul 31 '15 at 10:35