I'm developing an app using Kingfisher library to load image from ulr and display in CollectionViewCell
. I'm trying to resize the image to fit the Contentview
of CollectionViewCell
.
I have tried ResizeProcessor
and ScaleFactor
from the library but the result image seem blur
. My implementation is below (function is call in CellForRowAtIndexPath
)
let url = photo.flickrImageURL("m")
let size = contentView.frame.size
print("size is \(size.debugDescription)")
let resizeProcessor = ResizingImageProcessor(referenceSize: size, mode: .aspectFit)
self.flickrPhoto.kf.setImage(with: url, options: [.backgroundDecode,.processor(resizeProcessor), .scaleFactor(UIScreen.main.scale),.cacheOriginalImage])
Is there anything that I did wrong? The quality of images
seem very blur.