IDMPhotoBrowser
IDMPhotoBrowser copied to clipboard
Supporting SDWebImage
Would this project be open to supporting SDWebImage as the image cache and download engine, in addition to AFNetworking? Essentially, you could support both by breaking the URL loading and caching code into a category of IDMPhoto. Then, use cocoapods subspecs to allow developers to choose between SDWebImage and AFNetworking when installing the IDMPhotoBrowser pod. In fact, this strategy could be extended Here's what it would look like:
Install with AFNetworking:
pod 'IDMPhotoBrowser/Core'
pod 'IDMPhotoBrowser/AFNetworking ' # This adds IDMPhoto+AFNetworking
OR
Install with SDWebImage:
pod 'IDMPhotoBrowser/Core'
pod 'IDMPhotoBrowser/SDWebImage' # This adds IDMPhoto+SDWebImage
Both categories on IDMPhoto
would have the same networking methods (+ (IDMPhoto *)photoWithURL:(NSURL *)url;
), just different implementations.
Is there any particular reason you need or want to use SDWebImage to manage image downloads? Since AFNetworking works nice.
It's simply a choice of your image caching engine. If you're already using SDWebImage elsewhere, it makes sense to keep using it (rather than having two separate caches).
In general, I think a positive architectural change would be to factor out all of the cocoa pods dependencies of IDMPhotoBrowser
via sub specs (as mentioned above), or via delegate patterns. This is particularly important for UI elements (DACircularProgressView
), for app-specific UI consistency.
+1
+1
+1 for SDWebImage
+1
+1
+infinite
For me the biggest advantage is that SDWebImage supports disk caching whereas AFNetworking only supports memory caching. Concretely, that means that big images don't get cached at all and cache doesn't survive app restart.
maybe extract the cache interface, set default provider as AFNetworking but also allow other providers.
+1
I am interested. Thank you. How do you alter the podFile to implement this branch?
@robmontesinos here's how you tell cocoapods to go fetch a fork instead of the original project:
pod 'IDMPhotoBrowser', :git => 'https://github.com/[username]/IDMPhotoBrowser.git'
Thank you @sprint84!! I had different options to go from googling. I appreciate your super quick response!!
+1 for SDWebImage
+1
+1
+1