Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests for ASImageNode dynamic tint color #1644

Merged
merged 1 commit into from Aug 30, 2019

Conversation

vovasty
Copy link
Contributor

@vovasty vovasty commented Aug 26, 2019

no logic changes, just missing tests.

@@ -11,6 +11,18 @@

#import <AsyncDisplayKit/AsyncDisplayKit.h>

#if AS_AT_LEAST_IOS13
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why this method would need to be only used in iOS13+ only, is there a particular reason this is guarded?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dynamic color is only available for ios13


UIImage *image = makeImageWithColor(UIColor.redColor, CGSize{.width = 100, .height = 100});
image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
UIColor* tintColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if creating the color variants manually is helpful for debugging but if we just want a white/black color I would recommend [UIColor systemBackgroundColor]

@vovasty vovasty force-pushed the dynamic-tint-test branch 3 times, most recently from f813c33 to e6ba4de Compare August 27, 2019 19:54
@rahul-malik
Copy link
Contributor

@vovasty - It seems you will either need to add new tests that aren't under iOS 13 or add the define check to overcome this issue

 /Users/runner/runners/2.157.0/work/Texture/Texture/Tests/ASImageNodeSnapshotTests.mm:14:17: unused function 'makeImageWithColor' [-Werror,-Wunused-function]

static UIImage* makeImageWithColor(UIColor *color, CGSize size) { ❌ 

@vovasty vovasty merged commit 0cd5561 into TextureGroup:master Aug 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants