I am retrieving pictures from for a thumbnail but the pictures are too big so when laid out in a table, it takes ages for everything to load. Does anyone have suggestions on how to resize the image to about 50 * 50 so that the tableView loads faster? Swift3 Code examples would be appreciated since I am new to coding.
databaseRef.child(text).child("profit").observe(.value, with: { (snapshot) in
if snapshot.value is NSNull{
}else{
let equal = snapshot.value
/*friendsCell.profilePicture.loadImageUsingCacheWithUrlString(urlString: databaseProfilePic as! String )*/
self.imageLoader.startAnimating()
!
let data = NSData(contentsOf: NSURL(string: wow as! String)! as URL)
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
profit.sd_setImage(with: NSURL(string: profit as! String)! as URL, placeholderImage: UIImage(data: data! as Data))
self.imageLoader.stopAnimating()
}
}
})