Highlight search text after search in UITableView

Hi, can someone help me, how can the text be selected after the search, I want to search the data from the sqlite database and display it in a UITableView, so how can I highlight the search keyword only in the search results? Please, help?

+5
source share
1 answer

Here's how I would do it: create a custom cell and a view in that cell to include the text. You will need to use the main text to be able to change parts of the background / text color from your line. After the search, change the background color / color of the text in the drawRect method.

Please see this for more information on Core Text.

+1

All Articles