I have an array of CKRecords in an array. Using a table, im looking to use SDWedImage to act as a cache for the one CKAsset/Image in my Records. However, I'm having a difficult time creating a successful piece of code
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "restaurantcell") as? RestaurantTableCell cell?.dealsicon.layer.cornerRadius = 3 let restaurant: CKRecord = restaurantArray[indexPath.row] let asset = restaurant.value(forKey: "Picture") as! CKAsset let data = try! Data(contentsOf: asset.fileURL) cell?.restaurantImage.sd_setImage(with: data) return cell!}
However, with the use of the sd in code, I receive the "Cannot convert value of type 'Data' to expected argument type 'URL'?". How would I go about fixing this error? Is there an alternative to my let data constant that trys a URL instead of data?