title: Convert url to UIImage Swift3
body: <p>I try to convert url to UIImage by using following code :</p>
  
  <pre><code>            let url = URL(string: "http://www.apple.com/euro/ios/ios8/a/generic/images/og.png")
              let sessionTask = URLSession.shared
              let request = URLRequest(url: url!)
              let task = sessionTask.dataTask(with: request, completionHandler: {(data: Data?, response: URLResponse?, error: Error?) -&gt; Void in
                  if (error == nil) {
                      let image: UIImage = UIImage(data: data!)!
  
                  }
  
              })
              task.resume()
  </code></pre>
  
  <p>but it's not work for me, if-loop is not complied. </p>