이 코드를 사용하여 UICollectionView 내부에 일부 이미지를 표시하지만 셀이 25라고 말할 수 있습니다. 마지막 셀로 이동 한 다음 처음으로 이동하려고 시도합니다. 이미지가 다시로드됩니다 (캐시에서로드 표시기가 여전히 나타납니다.) 내 휴대 전화는 iPhone SE이며 많은 앱이없고 전화가 완벽하게 작동합니다. 내 앱을 많은 데이터가있는 이전 아이폰에로드하면 하여 컬렉션 인덱스 경로 ???에서 항목에 대한 기능 셀을 볼 내부에 우리가 이런 일을 피할 수있는 방법.이 끈적 매우 성가신된다 스크롤Swift 2의 캐시 된 이미지에서 끈적한 스크롤
let cell = collectionView.dequeueReusableCellWithReuseIdentifier("RecipesCell", forIndexPath: indexPath) as! RecipesCell
// Get Cover image
let myCache = ImageCache(name: recipesClass.objectId!)
let queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)
let optionInfo: KingfisherOptionsInfo = [
.DownloadPriority(0.5),
.CallbackDispatchQueue(queue),
.Transition(ImageTransition.Fade(1)),
.TargetCache(myCache)
]
if let imageFile = recipesClass[RECIPES_COVER] as? PFFile {
let URL = NSURL(string: imageFile.url!)!
cell.coverImage.kf_setImageWithURL(URL, placeholderImage: nil,
optionsInfo: optionInfo,
progressBlock: { receivedSize, totalSize in
print("\(indexPath.row + 1): \(receivedSize)/\(totalSize)")
},
completionHandler: { image, error, cacheType, imageURL in
print("\(indexPath.row + 1): Finished")
print("cacheType: \(cacheType) \(indexPath.row + 1): Finished")
})
} else {
cell.coverImage.image = UIImage(named:"logo")
}
사람이 같은 문제를 가지고 있습니까? 감사합니다!
가 참고로 나는 UI 키트에 대한 연구 일 후에 캐싱