iOS: Adding UISearchbar with filter Options in a tableview

∥☆過路亽.° 提交于 2019-12-04 05:28:52

UIKit comes with a dedicated built-in solution for searching in conjunction with a UITableViewController, called UISearchDisplayController. It provides everything (albeit without much customization), including the search bar view, an optional scope bar for filtering, and transitions.

Reference: https://developer.apple.com/library/ios/documentation/uikit/reference/UISearchDisplayController_Class/Reference/Reference.html

Edit:

Here is a tutorial: http://www.appcoda.com/search-bar-tutorial-ios7/

And here is another one that includes a scope bar: http://www.raywenderlich.com/16873/how-to-add-search-into-a-table-view

Edit: All of this is obsolete now

iOS8 introduces a new class UISearchController to make this much cleaner. See http://useyourloaf.com/blog/2015/02/16/updating-to-the-ios-8-search-controller.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!