Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Category methods collision #859

Closed
wants to merge 1 commit into from

Conversation

dmishe
Copy link

@dmishe dmishe commented Mar 21, 2013

Hey, there was an interesting issue on RestKit project RestKit/RestKit#1285

Looks like AFNetworking UIImageView category shares some method names with that of SDWebImage, which leads to weird bugs as seen above.

https://github.com/rs/SDWebImage/blob/master/SDWebImage/UIImageView%2BWebCache.h#L53
https://github.com/AFNetworking/AFNetworking/blob/master/AFNetworking/UIImageView%2BAFNetworking.h#L43

I wonder if there should be a af_ prefix, I understand that this will lead to big backwards compatibility breakage :/

/cc @rs

@blakewatters
Copy link
Contributor

A simple, lightweight solution for this in the context of a CocoaPods based install would be to move the UIImageView category into a subspec so that it can be installed optionally.

@AquaGeek
Copy link
Contributor

Backwards compatibility breakage or not, category methods should be prefixed to prevent this exact situation.

@nickjshearer
Copy link

According to #822 there are additional UIKit categories going in to 2.0, so perhaps that would be an appropriate point to split into a subspec covering all UI.

@kcharwood
Copy link
Contributor

sadface because of 1) that there is a collision, 2) the prefix naming is ugly to me, and 3) the api breakage you mentioned...

Sadfaces all around.

@mattt
Copy link
Contributor

mattt commented Apr 7, 2013

AFNetworking 2.0 will split the UIImageView category, along with other UIKit components into its own extension. This will obviate the need for an API change. For now, I will close this issue as "WontFix", though.

@mattt mattt closed this Apr 7, 2013
@mattt
Copy link
Contributor

mattt commented Apr 7, 2013

Of course, another solution would become strictly better than SDWebImage, making the situation moot ;)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
6 participants