I have post response i want to download image from image_path
let fileUrl = NSURL(fileURLWithPath: (posts.value(forKey: "image_path") as! [String])[indexPath.row])
print(fileUrl as Any) // here i can get path
if FileManager.default.fileExists(atPath: (fileUrl)// nil value {
let url = NSURL(string: (posts.value(forKey: "image_path") as! [String])[indexPath.row]) // Here url found nil
let data = NSData(contentsOf: url! as URL)
cell.LocationImage?.image = UIImage(data: data! as Data)
}
UPDATE:
That URL is not a local file path URL, nor a valid URL accoridng to my browser.
The URL you have provided above returns a server error in the browser and does not return an image. See screenshot
You would need to ensure that the image is accessible and the URL actually returns an image response firstly. Then you would need to download the image. Not sure if you are using any libraries or not so I will post an example without.
UPDATE: