Permalink
Browse files

Added UIColor.isEqual

  • Loading branch information...
1 parent 69a2463 commit 606504c6bbb7b4c4c9c5059fb51006765d01181c @hpique hpique committed Feb 23, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 UIKit/Classes/UIColor.m
View
8 UIKit/Classes/UIColor.m
@@ -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

0 comments on commit 606504c

Please sign in to comment.