//Set Up Search Bar
let searchBar = resultSearchController!.searchBar
searchBar.sizeToFit()
searchBar.placeholder = "Search For Locations And Places"
navigationItem.titleView = resultSearchController?.searchBar
//UISearchController Set Up
I'm fairly new to coding, so I'm not exactly sure what the issue is. I'm getting the error on the first line of code whenever I run my app. I thought it was the "?" in the last line of code was the problem causing this, but when I replaced it with "!" like the first line, it still didn't work. I tried replacing the "!" with a "?" and it didn't work either. I'm not sure how to solve this. I feel like it may have something to do with the first and last line though. Can anybody maybe explain this to me and help me solve to understand better?
Thanks so much.
-Deb