Reputation: 864
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.
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
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:
Upvotes: 1
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.
Click on segue and set identifier
as web_load then it can work properly.
Upvotes: 0