New to this, so please bear with me. I have set up an IBAction to allow for a URL to open in Safari when the button is tapped. The URL opens successfully, but then I receive error in AppDelegate.swift: unrecognized selector sent to instance. When troubleshooting, I set up the same code and same IBAction in the initial view controller, and i did NOT get the error, and was able to return back to the app (from Safari) successfully. It seems this is happening only in one specific View Controller, which is not the initial VC. I'm hoping this is just a rookie and/or trivial mistake. Thanks for any help :)
import UIKit
class WeekDetailViewController: UIViewController {
@IBOutlet weak var lessonCompleteBtn: UIButton!
@IBOutlet weak var stackOButton: UIButton!
@IBOutlet weak var stackExchButton: UIButton!
@IBOutlet weak var redditButton: UIButton!
@IBOutlet weak var facebookButton: UIButton!
override func viewDidLoad() {
super.viewDidLoad()
}
@IBAction func stackOButton(_ sender: Any) {
UIApplication.shared.open(URL(string: "https://www.google.com")! as URL, options: [:], completionHandler: nil)
}
}
Here is the problem: