I am using UISearchbar
in tableview controller in storyboard.
And searchbar returnKeyType
is UIReturnKeySearch
.
Its working fine with iOS7 but returnKeyType
is not working with iOS8.
in iOS8, return key appears every time in keyboard.
I tried to set returnkeytype
in viewDidLoad
method of controller too.
What I need to do to set returnKeyType = UIReturnKeySearch
in iOS8?
try this in
viewDidLoad
:I think you can go with your hard codded logic for right now. I will update if I will get better solution for your problem.
Try making IBOutlet of your SearchBar
and add the below line code to your viewDidLoad Method
I'm not sure if I understood your question correctly. You want to have "search" button instead of "return" button, right? There is a new SearchController in ios 8, give it a try:
And now the implementation:
You also have to implement method from UISearchResultsUpdating protocol:
EDIT: If it is not what you were looking for please comment, so I can update my answer accordingly
SearchViewController.h
SearchViewController.m
Building a SearchView with UISearchBar and UITableView
this might helps you :)