UISearchbar under tvOS: how to display the "search" button?

Hello


I have an iOS app which I try to make run on tvOS.

But I'm stuck with the search functionality. To show the search bar I use the UISearchController and try to configure its search bar to show a "search" button.

Under iOS the "Search" button is the keyord's "return" button.

But unter tvOS the keyborad doesn't even have a return button which I could configure to be used as "Search" button.


I also tried to Scope bar and then to define my own "Search" button. But as soon as the scope bar is activated the seach bar is hidden and can only be activated by "magic" what I don't really like.


I'm currently working only with the Apple tv simulator and therefore I don't know if the search bar has the same behavior on a real apple tv device.


Does anybody know how I have to configure the search bar to have the almost same behavior as unter iOS?


Here's my code which loads and configures the UISearchBarController:

  private func prepareSearchController()
  {
       self.searchFieldUiController = UISearchController(searchResultsController: self.foundItemsListViewController)
       self.searchFieldUiController.searchBar.placeholder = "Search fragments"
       //self.searchFieldUiController.searchBar.showsScopeBar = true
       //self.searchFieldUiController.searchBar.scopeButtonTitles = ["Search"]
       self.searchFieldUiController.searchBar.delegate = self
       self.searchFieldUiController.searchBar.sizeToFit()

       self.tableView.tableHeaderView = self.searchFieldUiController.searchBar
  }

  override func viewDidLoad()
  {
       prepareSearchController()
  }

I found a hint which maybe could help to find the answer but I searched for hours but could not find any helpful answer:


tvOS supports normal and inline keyboards.

It seems that normal keyboards can only be used for UITextField. Even though I'm hoping to find an answer how to use the UISearchController, its UISearchBar ans that there's any way to enable the return key of the inline keyboard or to define that the normal keyboard is used.


Has anyone an answer to my endless search?


Thanks a lot


Öpfelchnuscht

Did you solve your problem?

UISearchbar under tvOS: how to display the "search" button?
 
 
Q