-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conversation
d9a40fb
to
c5aa1b2
Compare
@@ -11,6 +11,18 @@ | |||
|
|||
#import <AsyncDisplayKit/AsyncDisplayKit.h> | |||
|
|||
#if AS_AT_LEAST_IOS13 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
Tests/ASImageNodeSnapshotTests.mm
Outdated
|
||
UIImage *image = makeImageWithColor(UIColor.redColor, CGSize{.width = 100, .height = 100}); | ||
image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; | ||
UIColor* tintColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) { |
There was a problem hiding this comment.
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]
f813c33
to
e6ba4de
Compare
@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) { ❌ |
e6ba4de
to
8c03d6b
Compare
no logic changes, just missing tests.