I am creating an application with a table view, which has a large amount of data in it. Because of this, it is necessary for me to use a search field.
Does anyone have any idea how to create a search-option in a tableview?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use the UISearchBar property, declare it using
and add it to your UIViewController’s view as a subview.
After that, use the searchbar delegate methods in your view controller:
Check out this tutorial to get a hang of the search bar and its delegates!
EDIT: This method isn’t about using a searchbar in tableview itself, but above it. That means you have to put tableView as a subview of a UIViewController, and the searchBar as a subview of the same UIViewController as well!