I'm trying to add another textfield for a 'Location' input to a UISearchController when the user focuses on the Search Bar, just below the Search Bar on the navigation bar.
Example of what I have and where I'd like it to go:
I've tried something like this, which doesn't work:
var searchController: UISearchController!
func searchBarTextDidBeginEditing(searchBar: UISearchBar) {
var myTextField: UITextField = UITextField(frame: CGRect(x: 0, y: 0, width: 200.00, height: 40.00))
myTextField.backgroundColor = UIColor.purpleColor()
myTextField.text = "Location"
myTextField.borderStyle = UITextBorderStyle.None
searchController.view.addSubview(myTextField)
}
Any help would be great! Thanks.