I use the WebServices(SOAP) to reach the data. I take the image urls from database , download them and show in TableView. here is my codes.
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "gorevlerCell",for: indexPath) as! GorevlerCell
cell.contentView.backgroundColor = UIColor(white: 0.95, alpha: 1)
// Fil the gorevler Cell
cell.txtGorevAdi.text = (gorevler.object(at: indexPath.row) as AnyObject).value(forKey: "Gorev_Adi") as? String
cell.txtGoreviAlan.text = (gorevler.object(at: indexPath.row) as AnyObject).value(forKey: "Gorevi_Alan") as? String
cell.txtGoreviVeren.text = (gorevler.object(at: indexPath.row) as AnyObject).value(forKey: "Gorevi_Veren") as? String
cell.txtTarih.text = (gorevler.object(at: indexPath.row) as AnyObject).value(forKey: "Tarih") as? String
cell.txtOncelikDurumu.text = (gorevler.object(at: indexPath.row) as AnyObject).value(forKey: "Oncelik_Durumu") as? String
// The Image File
let imgUrl2 = (gorevler.object(at: indexPath.row) as AnyObject).value(forKey: "Profil_Url") as? String
let trimmedImgUrl = imgUrl2?.trimmingCharacters(in: .whitespaces)
let url = NSURL( string : "http://"+trimmedImgUrl! )
let data = NSData(contentsOf: url! as URL)
let img = UIImage(data: data! as Data)
cell.profileImage.image = img
cell.profileImage.layer.cornerRadius = 35
cell.profileImage.layer.borderWidth = 2.0
cell.profileImage.layer.borderColor = UIColor.lightgray.cgColor
cell.profileImage.clipsToBounds = true
return cell}
So, When i added the image in the TableView and scrolled it , the application began slow down. My question is that why the application is slow down and how to faster it.
Note : i can try with low resolution image but still slow.