title: Validate URL without scheme
body: <p>Swift 5, Xcode 10, iOS 12</p>
  
  <p>My code uses <code>UIApplication.shared.canOpenURL</code> to validate URLs, which unfortunately fails without e.g. "http://".</p>
  
  <p>Example:</p>
  
  <pre><code>print(UIApplication.shared.canOpenURL(URL(string: "stackoverflow.com")!)) //false
  print(UIApplication.shared.canOpenURL(URL(string: "http://stackoverflow.com")!)) //true
  print(UIApplication.shared.canOpenURL(URL(string: "129.0.0.1")!)) //false
  print(UIApplication.shared.canOpenURL(URL(string: "ftp://129.0.0.1")!)) //true
  </code></pre>
  
  <p>I'm aware of the change with <a href="https://awkwardhare.com/post/121196006730/quick-take-on-ios-9-url-scheme-changes" rel="nofollow noreferrer">schemes</a> (iOS9+) and I know that I can just add a prefix like "http://" if the String doesn't start with it already, then check this new String but I'm still wondering:</p>
  
  <p><strong>Question:</strong> How do I add a "there's no scheme" scheme, so valid URLs like "stackoverflow.com" return <code>true</code> too (is this even possible?)?</p>