2017-04-18 2 views
1

URLからイメージをダウンロードしようとしていますが、イメージをぼかしてキャッシュし、それをテーブルビューのセルに表示しています。Imageにぼかしを適用し、Kingfisherでキャッシュする方法は?

私はこれでした:

let resource = ImageResource(downloadURL: url, cacheKey: recipe.uid) 
backgroundImageView.kf.setImage(with: resource) 
backgroundImageView.image = backgroundImageView.image?.kf.blurred(withRadius: CGFloat(7.6)) 

をしかし、これは私が私が欲しいたくない画像ビューにそれを設定した後、画像をぼかすことを意味します。 提案がありますか?ありがとう!

答えて

1

は解決策を見つけた:

let resource = ImageResource(downloadURL: url, cacheKey: recipe.uid) 
let processor = BlurImageProcessor(blurRadius: 4) 
backgroundImageView.kf.setImage(with: resource, placeholder: nil, options: [.processor(processor)], progressBlock: nil, completionHandler: nil) 
関連する問題