Check Mobile App
Read now
Start a Project

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:










. . .

Leave a Comment

Your email address will not be published. Required fields are marked*

Be the first to comment.


When I think in getting solutions for my Ecommerce Platform, I think of Webkul. They have been such a blessing in our business. We have spent thousands of dollars in support and modules from them. We love their support team. They work very closely with us, and they always go the extra mile when we need help.

Michael Urresta

Michael Urresta

Talk to Sales


Live Chat
Start a Project

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home