-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Refactor the cancel logic #771
Conversation
Conflicts: SDWebImage/MKAnnotationView+WebCache.m SDWebImage/UIButton+WebCache.m SDWebImage/UIImageView+HighlightedWebCache.h SDWebImage/UIImageView+HighlightedWebCache.m SDWebImage/UIImageView+WebCache.m
anybody agree with me? |
@Whirlwind You worked a bit on this :) It's a big change to me and I must say I don't know if we really need this. What issues are you trying to fix with this? |
I had said the reason. And if we will not need it, you should check and fix all cancel methods!! |
I personally like the change. It will certainly easier to maintain and less error prone. |
Ok. Merging based on @rs's comment. |
Consolidating some of the category functionality into a single utility class and enhancing the cancelation behavior seems like a good thing to do, so I approve as well. There's actually even more stuff that could be shared here. The main thing I'd personally do differently is to define a new class for the shared functionality instead of cramping the shared code into a UIView category. Adding base classes like UIView should in my opinion be done only if it really makes sense. Something like +[SDWebImageCache setImageLoadOperation:onObject:forKey:] could do the same thing. There were also some public API changes here, that were made without first marking the methods as deprecated or something like that. Probably not a big deal, but in general it's better if API changes (e.g., renaming methods) are only made with major releases. |
@matej you are right, we should deprecate the old methods. |
…m so we are backwards compatible.
Update: I did deprecate them, just 2 methods |
Great. Thanks. |
…ecated them so we are backwards compatible.
I found there are many cancel function in each categories. But they are some error:
UIControlState
argument.So I refactor the cancel logic to easy.