I implemented a search function by creating a table view and adding a searchbar in the storyboard.
However, when I first start, the searchbar is visible and when I scroll the table view, the searchbar is hidden. I want the searchbar to be hidden from the beginning.
I tried below but without success
Is it possible to hide the searchbar from the beginning?
Please note that I cannot use the method of adding a search bar to the navigation bar because I hide the navigation bar.
@IBOutlet var searchBar: UISearchBar!
tableView.contentOffset = CGPoint(x: 0, y: -100)