pre cache AttachmentType

This commit is contained in:
nixzhu
2015-12-08 11:05:02 +08:00
parent fed5ffb182
commit 2785cf9c19
@@ -193,6 +193,18 @@ class MediaPreviewViewController: UIViewController {
view.addGestureRecognizer(swipeDown)
currentIndex = startIndex
for previewMedia in previewMedias {
if case let .AttachmentType(attachment) = previewMedia {
ImageCache.sharedInstance.imageOfAttachment(attachment, withSize: nil, completion: { [weak self] (url, image, _) in
if let image = image {
self?.attachmentImagePool.addImage(image, forKey: attachment.URLString)
}
})
}
}
}
var isFirstLayoutSubviews = true