Jacky Shek
Jacky Shek

Reputation: 955

Receiver has no segue with identifier 'contact_segue'

I have a problem that the self.performSegueWithIdentifier("contact_segue", sender: self) do not work and complain that Receiver has no segue with identifier 'contact_segue' even i have the identifier. I have used the SWReveal framework to build the left-side sliding menu which is work with table view(class: slidingMenuController). After I clicked the cell to call function changeView of MainNavigationController to do changing views.

import UIKit

class MainNavigationController: UINavigationController {

override func viewDidLoad() {
    super.viewDidLoad()


}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}
override func viewDidAppear(animated: Bool){
    super.viewDidAppear(false)
    self.performSegueWithIdentifier("Home", sender: self)
}


override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!) {
    if segue.identifier == "Contact_se" {

    }
}
func changeView(){
       self.performSegueWithIdentifier("contact_segue", sender: self)      
    }
}

The changeView which is called by an a left-side sliding menu (class: slidingMenuController) in a tablecell:

 override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {

        let selectedItemMenu = arrayOfSlider[indexPath.row]

        let mainNav = MainNavigationController()

         mainNav.changeView()
    }

Existing Segue

Upvotes: 0

Views: 1160

Answers (1)

Rhenz
Rhenz

Reputation: 2293

Just add this code self.performSegueWithIdentifier("contact_segue", sender: self) on your didSelectRowAtIndexPath? I believe there's no need for the MainNavigationController here.

Upvotes: 2

Related Questions