Read More

Implement UISearchController with Custom UIViewController Support in Swift 4.2

UISearchController with Custom UIViewController Support

Sometimes we need to use search suggestion within the same page that will show over the current screen for that we can use UISearchController with one Target Controller, for this follow these steps.

Here we are taking  2 controllers where one controller loads another controller over the screen.

1: Define First Controller:

Create A UIview On controller  & create their outlet.

Now write this code on ViewDidLoad()

Note: here  “TableViewControllerClass” is another UITableViewController class that will load when the user click on the search bar.

2:Define the  TableViewControllerClass

 

 

Note: ” func updateSearchResults(for searchController: UISearchController)”  this method will call every time when the user clicks on search bar & type on search bar so this method will help to reload the data or update the data in that controller.

Now it will look like this:

 

 

 

 

 

 

 

 

 

. . .

Comment

Add Your Comment

Be the first to comment.

css.php
Hire Us!
Brief us about your requirements and we'll get back to you.
Woo! Hooy!
We have just recieved your project brief and our expert will contact you shortly.
Send Again
Close