Closed nikmacintosh closed 5 years ago
Thanks @knickmack. However I cannot merge the changes like they are, as they break the API compatibility.
I don't know how we can solve that, actually. The idea would be making new methods with that prefix in the signature, but leaving the old ones there as well deprecating them. So the change wouldn't fix the collision with SSToolkit in the next release; it only would make developers to update their code for a future release without those methods.
I've added in deprecation warnings and documentation, if you'd like to pull that in.
+1 I'd like to cast my vote to look into finding a reasonable solution since I ran into this issue too. I can hack it in the meantime with @knickmack's commits but that's not a long-term solution.
Hi, Is it possible that using the PrettyKit to display images? Is there any sample code?
One very hacky solution to, at least, the API incompatibility between SSToolkit and PrettyKit, is to cast a hex string passed to [UIColor colorWithHex:]
as an int, seemingly satisfying both APIs, and having the intended result.
Example:
_viewController.view.backgroundColor = [UIColor colorWithHex:(int)@"0x0000FF"];
The above will not crash, and show the intended blue.
Using
PrettyKit
alongside SSToolkit results in a naming collision between publicly visible categories onUIColor
.[UIColor colorWithHex:]
inPrettyKit
expects anint
as a parameter, whereasSSToolkit
expects anNSString
. Since bothPrettyKit
andSSToolkit
are popular, it's reasonable to assume more will encounter this incompatibility. This pull request prefixes category methods inPrettyKit
withpretty_
, avoiding future namespace collisions.