Displaying search bar in navigation bar in iOS 8

According to Apple : UISearchDisplayController is deprecated in iOS 8. (Note that UISearchDisplayDelegate is also deprecated.) To manage the presentation of a search bar and display search results in iOS 8 and later, instead use UISearchController. The UISearchController class defines an interface that manages the presentation of a search bar in concert with the search … Read more

Adding UISearchBar programmatically to UITableView

To add a UISearchBar to a UITableView there are these things to do: Declare and initialize UISearchBar Declare and initialize the UISearchDisplayController Add the searchBar to the tableView Implement the UISearchDisplayController delegate In the header file I declare my searchBar, searchDisplayController and the arrays that contain the data to display. ViewController.h: #import @interface ViewController : … Read more

tech