I have a single storyboard with 4 screens (segue to each ViewControllers).
An Open Url sequence WILL NOT WORK on any of the additional 3 screen ViewControllers.
It only works on the main View Controller or on a separate storyboard (manual segue).
The View Controllers were created using Cocoa Touch Class: UIViewController.
Throws this error:
Thread 1: “[<UIViewController 0x10b318630> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key WebButton.”
I’ve wiped all possible stray connections.
This code works perfectly fine ONLY on the main and separate storyboards:
@IBAction func GoToWebsite(_ sender: UIButton) {
if let url = URL(string: "https://www.google.com") {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
}
I am missing some bit of information…
Thank you.
user26546618 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.