Hi guys ,Tableview is working but when I segue data labels ok but image can’t convert**
ViewController
``
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) → UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "hucrem", for: indexPath) as? TableViewCellim
cell?.baslikLabel.text = postDizisi[indexPath.row].baslik
cell?.detayLabel.text = postDizisi[indexPath.row].detay
postDizisi[indexPath.row].resim.getDataInBackground { data, error in
if error == nil {
if let data = data {
cell?.imageViewim.image = UIImage(data: data)
}
}
}
return cell!
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
performSegue(withIdentifier: "toDetay", sender: indexPath.row)
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "toDetay" {
if let indexpath = viewControllerim.indexPathForSelectedRow {
let desti = segue.destination as! jsonController
desti.baslik = postDizisi[indexpath.row].baslik
desti.detay = postDizisi[indexpath.row].detay
desti.resim = postDizisi[indexpath.row].resim
}
}
}
}
**jsonController.swift**
var baslik:String?
var detay:String?
var resim:PFFileObject?
@IBOutlet weak var baslikLabel: UILabel!
@IBOutlet weak var resimView: UIImageView!
@IBOutlet weak var detayLabel: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
baslikLabel.text = baslik
detayLabel.text = detay
resimView.image = resim
}
}