I have two scenes which can be accessed through a tab bar, on scene 1 there is a search bar. the problem that I am facing is that while searching if I switch to the download
Looks like the view that your UISearchController
is attached to gets removed from the view hierarchy. You can think of the UISearchController
as being presented modally when you start searching, and the definesPresentationContext
property indicates which UIViewController
would be the one to present it (more on this).
You can get more detail in the answer to a possibly duplicate question: https://stackoverflow.com/a/37357242/300131