颜色判断

#pragma mark -色值判断

-(BOOL)firstColor:(UIColor*)firstColor secondColor:(UIColor*)secondColor

{

    if (CGColorEqualToColor(firstColor.CGColor, secondColor.CGColor))

    {

        NSLog(@"颜色相同");

        return YES;

    }

    else

    {

        NSLog(@"颜色不同");

        return NO;

    }

}

  [self firstColor:_startButton.backgroundColor secondColor:[UIColor redColor]];

[self firstColor:_startButton.backgroundColor secondColor:_closeButton.backgroundColor];
原文地址:https://www.cnblogs.com/walkingzmz/p/7262165.html