'Swift UITableView with search bar and perform an Unwind Segue

So I have a UITableViewController with a UISearchBar. I want to simply select a name and then unwind back to the AddTicketTVC with the selected info. This works except when I start typing and filter my array. I select the row and get a popToViewController:transition: called on error. I have a very basic understanding of this.

I have seen a fix that states to dismiss the SearchBarController. Or To use the TableView delegate to do the filtering. Either way, the help didn't provide any code to help. I have search on how to do this and haven't found any code to help.

I tried using the following:

searchController.isActive = false
dismiss(animated: true)

This just completely dismissed the whole ViewController. Any help or point towards a tutorial would help. I used the following tutorial to help design the searchBar: https://www.raywenderlich.com/4363809-uisearchcontroller-tutorial-getting-started



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source