IDMPhotoBrowser icon indicating copy to clipboard operation
IDMPhotoBrowser copied to clipboard

Supporting SDWebImage

Open sibljon opened this issue 11 years ago • 19 comments

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.

sibljon avatar Oct 27 '13 16:10 sibljon

Is there any particular reason you need or want to use SDWebImage to manage image downloads? Since AFNetworking works nice.

eduardocallado avatar Nov 04 '13 16:11 eduardocallado

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).

sibljon avatar Nov 04 '13 16:11 sibljon

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.

sibljon avatar Dec 06 '13 18:12 sibljon

+1

kukat avatar Mar 26 '14 04:03 kukat

+1

smn8600 avatar Apr 30 '14 13:04 smn8600

+1 for SDWebImage

sprint84 avatar May 13 '14 21:05 sprint84

+1

ipeisong avatar Aug 21 '14 08:08 ipeisong

+1

DDany avatar Oct 10 '14 08:10 DDany

+infinite

PhillipApps avatar Oct 10 '14 09:10 PhillipApps

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.

sarbogast avatar Jan 09 '15 10:01 sarbogast

maybe extract the cache interface, set default provider as AFNetworking but also allow other providers.

ipeisong avatar Jan 10 '15 11:01 ipeisong

+1

zhouzhui avatar Feb 15 '15 15:02 zhouzhui

I am interested. Thank you. How do you alter the podFile to implement this branch?

robmontesinos avatar Feb 16 '15 19:02 robmontesinos

@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'

sprint84 avatar Feb 16 '15 19:02 sprint84

Thank you @sprint84!! I had different options to go from googling. I appreciate your super quick response!!

robmontesinos avatar Feb 16 '15 19:02 robmontesinos

+1 for SDWebImage

isaced avatar Jul 06 '15 10:07 isaced

+1

tounaobun avatar Jul 27 '15 05:07 tounaobun

+1

maimake avatar Aug 11 '15 15:08 maimake

+1

Roshanzs avatar Jan 28 '16 15:01 Roshanzs