Shaheen Rehman
Shaheen Rehman

Reputation: 491

Highlight the search text after searching in a UITableView

Hi can anyone help me how text can be highlighted after search, i want to search data from sqlite database and display it in a UITableView, so how i can highlight the search keyword only in the search Result? Please help?

Upvotes: 5

Views: 2315

Answers (1)

Basel
Basel

Reputation: 2368

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 core text to be able to change the parts of background/text color from your string. Upon your search, change the color/background color of text in drawRect method.

Please see this for more about Core Text.

Upvotes: 1

Related Questions