0

I need to go to a new table view on beginning editing of a search bar in the current view as shown in the picture below.

enter image description here

So far I have created a segue as per this answer, and used the following code in my current controller with the search bar.

Declarations:

lazy   var searchBar:UISearchBar = UISearchBar(frame: CGRectMake(0, 40, 140, 40))

in viewDidLoad:

searchBar.delegate = self;

and also the following function (showSearchResults is the id of the segue):

func searchBarTextDidBeginEditing(searchBar: UISearchBar){

        self.performSegueWithIdentifier("showSearchResults", sender: self)
    }

What I want to happen is the new controller to appear when i click onthe search box, but I get this error:

2016-07-28 15:42:25.750 ABCApp[7745:3279712] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver (<ABCApp.HomePageViewController: 0x7b08e910>) has no segue with identifier 'showSearchResults''
*** First throw call stack:

-----

libc++abi.dylib: terminating with uncaught exception of type NSException

Any idea?

Community
  • 1
  • 1
toing_toing
  • 2,334
  • 1
  • 37
  • 79

0 Answers0