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()
}