Some people have used prefixes to name their category methods in order to prevent possible name collisions with other external code, but I personally find that adding noise to a name that is otherwise clear. Is there a better way to avoid category name collisions than prefixing it?
e.g.
@interface UILabel (Extras)
-(void)prefix_extraMethod;
@end
In Objective-C doesn't exist namespace so the only way is to prefix your method.
If don't want to prefix (I agree with you..it's ugly) you can the OBJC_PRINT_REPLACED_METHODS
environment variable to YES
to receive a warning if you method name collide with other existing method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With