Url :- https://newdrcom.azurewebsites.net/DoctorsList.aspx
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = doctorsTableView.dequeueReusableCell(withIdentifier: "DoctorTableViewcellTableViewCell", for: indexPath) as! DoctorTableViewcellTableViewCell
let doctor = doctorData[indexPath.row]
cell.doctorname.text = doctor.name
cell.doctorDepartment.text = doctor.department
cell.doctorspeclization.text = doctor.specialization
cell.hospitalName.text = doctor.hospital
// cell.doctorimg.image = UIImage(named: doctor.picture ?? "")
guard let receivedImage = try? Data(contentsOf: URL(string: doctorData[indexPath.row].picture ?? "")!) else {
return cell
}
cell.doctorimg.image = UIImage(data: receivedImage)
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 360
}
}
Getting this error :-
Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value
Synchronous URL loading of http://flspinalsurgeon.com/wp-content/uploads/2016/06/704ef3f5ca13ed331b597014a1f3fe7a_400x400.jpeg should not occur on this application's main thread as it may lead to UI unresponsiveness. Please switch to an asynchronous networking API such as URLSession.