I'm trying to figure out how to add a searchbar and a scope as a header to my UIViewController. The issue is I don't know the code to add it as a header.
func customizeSearch() {
let searchBar = UISearchBar(frame: CGRect(x:0, y:0, width: (UIScreen.main.bounds.width), height: 70))
searchBar.backgroundColor = UIColor.black
searchBar.delegate = self
searchBar.scopeButtonTitles = ["All", "Forwards", "Defensemen", "Goalies"]
//self.tableView.tableHeaderView = searchBar if I had a tableview, I have a vc.
}
func customizeSearch() {
let searchBar = UISearchBar(frame: CGRect(x:0, y:0, width: (UIScreen.main.bounds.width), height: 70))
searchBar.backgroundColor = UIColor.black
searchBar.delegate = self
searchBar.scopeButtonTitles = ["All", "Forwards", "Defensemen", "Goalies"]
//self.tableView.tableHeaderView = searchBar if I had a tableview, I have a vc.
}