has no segue with identifier error iOS storyboard

When I read the QR code, I want to open the viewcontroller with the webview. But I get the error in the title. Even though I have made the relationship between Viewcontroller and defined it, I still get this error. I defined it in web_load, but it still looks undefined.

Realtionship

identifier

 func launchApp(decodedURL: String) {
           if let url = URL(string: decodedURL) {
                  if UIApplication.shared.canOpenURL(url) {
                     // UIApplication.shared.open(url)
                    self.performSegue(withIdentifier: "web_load", sender: nil)

                  }
              }
          }) }
    override func prepare(for segue: UIStoryboardSegue, sender: Any?){
        if segue.identifier == "web_load"{
            if let nextVC = segue.destination as? DetailsViewController {
                       nextVC.scannedCode = messageLabel.text
                   }
        }
    }

Upvotes: 1

Views: 106

Answers (2)

Haya Hashmat
Haya Hashmat

Reputation: 137

Make sure you have set "web_load" as a storyboard ID not as an identifier.

Follow this step select the segue arrow -> got to attribute inspector -> identifier(web_load)

like this:

enter image description here

Upvotes: 1

Kishan Suthar
Kishan Suthar

Reputation: 658

webload is segue identifier so that you can not set on viewController Storyboard ID you need to set as per given below screenshot.

Storyboard ID in need to set Your ViewController name.

enter image description here

Click on segue and set identifier as web_load then it can work properly.

enter image description here

Upvotes: 0

Related Questions