Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added UIColor.isEqual

  • Loading branch information...
commit 606504c6bbb7b4c4c9c5059fb51006765d01181c 1 parent 69a2463
Hermes Pique hpique authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 UIKit/Classes/UIColor.m
8 UIKit/Classes/UIColor.m
View
@@ -254,4 +254,12 @@ - (NSString *)description
return [NSString stringWithFormat:@"<%@: %p; colorSpace = %@; components = %@>", [self className], self, colorSpace, componentsString];
}
+- (BOOL) isEqual:(id)object {
+ if (![object isKindOfClass:[self class]]) {
+ return NO;
+ }
+ UIColor* color = (UIColor*) object;
+ return CGColorEqualToColor(self.CGColor, color.CGColor);
+}
+
@end
Please sign in to comment.
Something went wrong with that request. Please try again.