Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use PromiseKit 2.0 since SGImageCache is requiring 1.5 #19

Open
xezero opened this issue Jun 3, 2015 · 5 comments
Open

Can't use PromiseKit 2.0 since SGImageCache is requiring 1.5 #19

xezero opened this issue Jun 3, 2015 · 5 comments

Comments

@xezero
Copy link

xezero commented Jun 3, 2015

Error when trying to pod 'PromiseKit', "~> 2.0"

[!] Unable to satisfy the following requirements:

- `PromiseKit/base (~> 1.5)` required by `SGImageCache (2.2.0)`
@xezero
Copy link
Author

xezero commented Jun 3, 2015

PromiseKit 2.0 also notably brings the idea of canceling a promise! Seems like it could be useful for SGImageCache if one wants to cancel an image request entirely!? :) A good example would be if we know we're not going to need to retrieve those images anymore, we can free up the slow queue from having to fetch them at some point, since right now the only way to free up the fast queue is to move images to the slow queue.

@staminajim
Copy link
Contributor

The problem here is that PromiseKit 2.0 only works with deployment targets of iOS 8 and higher because it's written in swift, and cocoa pods can only include swift frameworks with iOS 8 targets.

I think this might mean dropping iOS 7 support unless we can figure out a way around that - which would be less than ideal.

@staminajim
Copy link
Contributor

So I had a play around and almost had a way to have an iOS7 only subspec but there's another difficult problem where PMKPromise is objc_subclassing_restricted in PromiseKit 2.0.

SGImageCache is currently relying on being able to subclass that object for the onRetry and onFail blocks.

Maybe if there's a way to implement those using vanilla PMKPromise objects we could make the jump to 2.0.

@xezero
Copy link
Author

xezero commented Jun 4, 2015

Hm, my first thought would be to add some category methods and associated objects for the PMKPromise class? A less simplistic (but fun!) alternative could be adding some methods at runtime via class_addMethod.

@staminajim
Copy link
Contributor

Well if there's any way to get a PMKPromise to fire a .then or similar call multiple times then we could fire those onRetry and onFail blocks a different way.

I'm not aware of any way to do that, but I'm also admittedly not overly familiar with advanced promise kit usage. It'd be fantastic if anybody knows a way to do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants