Post looking at the stack trace, I now check existence of http or https via the following
if ["http", "https"].contains(url.scheme?.lowercased() ?? "") {
log.info("Can open with SFSafariViewController")
let safariViewController = SFSafariViewController(url: url)
self.present(safariViewController, animated: true, completion: nil)
} else {
log.info("If scheme is not supported or no scheme is given, use openURL")
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
How do I go about writing a test for this? Or how do I even go about testing this in any which way? It doesn’t crash on the simulator or the device I own