This is really weird. Comparison +[UIColor redColor]with red I create myself, gives an equal result, but comparison +[UIColor whiteColor]with another white does not.
XCTAssertEqualObjects([UIColor redColor],
[UIColor colorWithRed:1.0 green:0.0 blue:0.0 alpha:1.0],
@"Red should equal red.");
XCTAssertEqualObjects([UIColor whiteColor],
[UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0],
@"White should equal white.");
While I am expanding UIColorwith some useful additions, this fact can be very annoying.
Can anyone shed some light on this for me?
source
share