Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ private final class CachedImageProvider: AnimationImageProvider {
// MARK: Public

public func imageForAsset(asset: ImageAsset) -> CGImage? {
if let image = imageCache.object(forKey: asset.id as NSString) {
if imageProvider.ignoreInternalImageCache == false, let image = imageCache.object(forKey: asset.id as NSString) {
return image
}
if let image = imageProvider.imageForAsset(asset: asset) {
Expand Down
10 changes: 10 additions & 0 deletions Sources/Public/ImageProvider/AnimationImageProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,15 @@ import Foundation
/// Additionally custom Image Providers can be made to load images from a URL,
/// or to Cache images.
public protocol AnimationImageProvider {

var ignoreInternalImageCache: Bool { get set }

func imageForAsset(asset: ImageAsset) -> CGImage?
}

public extension AnimationImageProvider {
var ignoreInternalImageCache: Bool {
get { return false }
set { }
}
}