Skip to content

Commit 7d878be

Browse files
committed
Expose protocol to get image data from the cache plus WebP cleanup
## Summary Recently we made several headers private in Cocoapods. However, some clients were reaching directly into PINRemoteImage's memory cache (PINCache) and pulling out `PINRemoteImageMemoryContainer` and doing whatever with it. To support that use case without exposing more than necessary publicly, introduce the `PINRemoteImageDataConvertible` protocol and have `PINRemoteImageMemoryContainer` conform to it. So if previously the code was: ``` PINRemoteImageMemoryContainer *container = [[PINRemoteImageManager sharedImageManager].cache objectFromMemoryForKey:imageURL.absoluteString]; NSData *cachedImageDataForURL = [container data]; ``` it can be ``` id<PINRemoteImageDataConvertible> container = [[PINRemoteImageManager sharedImageManager].cache objectFromMemoryForKey:imageURL.absoluteString]; NSData *cachedImageDataForURL = [container data]; ``` Also, previous changes required `PIN_WEBP` to be defined in the project settings or it would fail to compile. That's been changed to always build. If _not_ specified it will default to `1`. ## Test plan Run `make all` to run tests and build everything
1 parent c6e0d06 commit 7d878be

File tree

5 files changed

+31
-40
lines changed

5 files changed

+31
-40
lines changed

0 commit comments

Comments
 (0)