I am trying to execute a push segue from a navigation controller after rejecting the modal that was previously introduced in the navigation controller .
Inside the modal ( UIViewController ):
func textFieldShouldReturn(textField: UITextField) -> Bool { var searchNav = SearchNavigationController() self.dismissViewControllerAnimated(true, completion: {searchNav.goToNextView()}) return true }
Inside the SearchNavigationController :
func goToNextView() { performSegueWithIdentifier("searchNavigationToNextView", sender: self) }
The problem is that when I press return, I get this error:
Application termination due to the uncaught exception "NSInvalidArgumentException", reason: "The receiver () does not have the identifier 'searchNavigationToNextView' '
Seg is present in my storyboard , moving from the UINavigationController to the next view .

EDIT: tried this where _sender is declared in SingleSearchViewcontroller as var _sender = self, and this did not work.
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "searchNavigationToSingleSearch" { let singleVC = segue.destinationViewController as! SingleSearchViewController singleVC._sender = self } }
source share