title: let url = URL(string: item)! returning nil in swift
body: <p>Really cannot figure this one out, the URL prints and is not equal to <code>nil</code>, and it works in the browser when I paste it in. Any ideas?</p>
  
  <pre><code>import UIKit
  
  class WebViewController: UIViewController {
  
      var postLink: String = String()
      @IBOutlet weak var mywebView: UIWebView!
  
      override func viewDidLoad() {
          super.viewDidLoad()
          print(postLink)
  
          let attempt = postLink
          let url: URL = URL(string: attempt)!
          let request: URLRequest = URLRequest(url: url)
          mywebView.loadRequest(request)
  
      }
  </code></pre>
  
  <p>The error occurs at: </p>
  
  <blockquote>
    <p>let url: URL = URL(string: attempt)!</p>
  </blockquote>