As you can see in the 1st Image . No text visible in UITableviewCell
.
After I scroll it appears and resize the cell. I want to resize cell according to UIImage
. I am fetching image from API using SDWebImage
.
I am putting code I have done in UITableView Cell for row method .
cell.imgViewSlide.sd_setImage(with: URL(string:
self.arrSliderImage[indexPath.row]), placeholderImage: UIImage(named: "HomeSliderImage"), options: .continueInBackground) { (image, error, type, url) in
let screenBounds = UIScreen.main.bounds
let pixelWidth = Int((image?.size.width)!)
let pixelHeight = Int((image?.size.height)!)
let height = ((pixelHeight * Int(screenBounds.width)) / pixelWidth)
cell.heightImage.constant = CGFloat(integerLiteral: height)
}
I have applied plenty of solution but not working correctly.