title: How can I use url variable as url request?
body: <p>I want to use my variable 'real url' to url request.
  I declared real url in app delegate like this:</p>
  
  <pre><code>AppDeleGate.swift:
  
  import ...
  
  ..
  @UIApplicationMain
  class AppDelegate: UIResponder, UIApplicationDelegate {
      var realurl : URL?
  ..
  </code></pre>
  
  <p>And, I want to use that url in <code>DetailController</code></p>
  
  <pre><code>DetailController.swift:
  
  ...
  @IBOutlet weak var webView: WKWebView!
  
      override func viewDidLoad() {
          super.viewDidLoad()
          let ad = UIApplication.shared.delegate as? AppDelegate
          let request = URLRequest(url: URL(ad?.realurl)!)
          webView.configuration.preferences.javaScriptEnabled = true
          webView.load(request)
  ...
  </code></pre>
  
  <p>but error... in ad?.realurl
   <a href="https://i.stack.imgur.com/94Jdn.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>how can I solve this problem?</p>