How can a UITableView be navigated with arrow keys (physical keyboard) much like the spotlight behavior that was introduced in iOS 10?
Looking to have a user type into a search box and use the up/down arrow to highlight a row in a tableview and press return key to select the row.
I have not found any resources on the topic.
Please provide sample code in Swift.
Did not try it, but this could be the answer for you.
self.tableView.scrollToRowAtIndexPath(indexPath, atScrollPosition: .Top, animated: true)
and use the text field delegate to handle return.
Edit: For highlighting use
tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell!
and update your cell visual
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With