Skip to content

Instantly share code, notes, and snippets.

@codeman7
Created September 18, 2018 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codeman7/bdace33da64539fadbe3a38bc5203501 to your computer and use it in GitHub Desktop.
Save codeman7/bdace33da64539fadbe3a38bc5203501 to your computer and use it in GitHub Desktop.
Testing colors in ObjectiveC
UIColor *expectedColor = [UIColor.blackColor colorWithAlphaComponent:0.87];
UIColor *titleColor = self.actionSheet.header.titleLabel.textColor;
XCTAssertEqualObjects(expectedColor, titleColor); // Doesn't work
XCTAssertEqualObjects(self.actionSheet.header.titleLabel.textColor,
[UIColor.blackColor colorWithAlphaComponent:0.87]); // Works
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment