I am trying to load pdf in `webView` but api link is come from api and I want to open that link in `webView` which is actually on another `viewController` so I am passing link to that view and load into `webView` but I am getting error like this:

> 
> Could not cast value of type '\_\_NSCFString' (0x1032a04f0) to 'NSURL' (0x1032a21b0).
> 
> 
> 

```
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
    let view: PDFViewController = self.storyboard?.instantiateViewController(withIdentifier: "PDFViewController") as! PDFViewController

    let pdf = eCataLogList[indexPath.row]["pdf_file"]
    let request = NSURLRequest(url: (pdf as? URL)!)
   // let request = NSURLRequest(url: pdf as! URL);
    view.pdf_web.loadRequest(request as URLRequest)
    self.navigationController?.pushViewController(view, animated: true)
} 

```