title: URL(string:) Cannot call value of non-function type 'String'
body: <p>I have the follow code but I am getting an error.</p>
  
  <pre><code>if let userImageURL = user.image {
      let url = URL(string: userImageURL)
  }
  </code></pre>
  
  <p>How am I supposed to create url? <code>URL(string:)</code> is supposed to take a <code>String</code> isn't it? And that's what <code>userImageURL</code> is. </p>
  
  <p>EDIT: Here's an example of the code I'm trying to implement. Even in this example, I'm getting the same error for <code>catPictureURL</code></p>
  
  <pre><code>let catPictureURL = URL(string: "http://i.imgur.com/w5rkSIj.jpg")!
  
  // Creating a session object with the default configuration.
  // You can read more about it here https://developer.apple.com/reference/foundation/urlsessionconfiguration
  let session = URLSession(configuration: .default)
  
  // Define a download task. The download task will download the contents of the URL as a Data object and then you can do what you wish with that data.
  let downloadPicTask = session.dataTask(with: catPictureURL) { (data, response, error) in
      // The download has finished.
      if let e = error {
          print("Error downloading cat picture: \(e)")
      } else {
          // No errors found.
          // It would be weird if we didn't have a response, so check for that too.
          if let res = response as? HTTPURLResponse {
              print("Downloaded cat picture with response code \(res.statusCode)")
              if let imageData = data {
                  // Finally convert that Data into an image and do what you wish with it.
                  let image = UIImage(data: imageData)
                  // Do something with your image.
              } else {
                  print("Couldn't get image: Image is nil")
              }
          } else {
              print("Couldn't get response code for some reason")
          }
      }
  }
  
  downloadPicTask.resume()
  </code></pre>