Book Image

iOS Development with Xamarin Cookbook

By : Dimitrios Tavlikos (USD)
Book Image

iOS Development with Xamarin Cookbook

By: Dimitrios Tavlikos (USD)

Overview of this book

Table of Contents (22 chapters)
iOS Development with Xamarin Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Searching through the data


In this recipe, we will learn how to provide search functionality for the content in a table view.

Getting ready

Create a new project in Xamarin Studio and name it SearchTableApp. Add UIViewController and name it SearchController.

How to do it...

Perform the following steps:

  1. Open the SearchController.xib file in Interface Builder. Add Search Bar and Search Display Controller in UITableView. The following screenshot shows the UISearchDisplayController object selected in the object browser:

    Note

    Note that after this action, some outlets are created and connected automatically. We need most of them, so we leave them as they are.

  2. Add UITableView and connect it to an outlet. Save the document.

  3. Back in Xamarin Studio, create a UITableViewSource subclass that will act as the data source for the table view. Refer to the Displaying data in a table recipe in this chapter for information on how to do this. This time, make sure that the List<string> variable, which will hold...