-
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
introduction of ASGraphicsCreateImageWithTraitCollectionAndOptions
#1675
introduction of ASGraphicsCreateImageWithTraitCollectionAndOptions
#1675
Conversation
329075e
to
0c79bbe
Compare
Source/AsyncDisplayKit.h
Outdated
@@ -130,3 +130,5 @@ | |||
#import <AsyncDisplayKit/IGListAdapter+AsyncDisplayKit.h> | |||
#import <AsyncDisplayKit/AsyncDisplayKit+IGListKitMethods.h> | |||
#import <AsyncDisplayKit/ASLayout+IGListKit.h> | |||
|
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.
please remove this whitespace.
0c8d59d
to
2c29705
Compare
Source/Details/ASGraphicsContext.h
Outdated
* | ||
* @return The rendered image. You can also render intermediary images using UIGraphicsGetImageFromCurrentImageContext. | ||
*/ | ||
NS_AVAILABLE_IOS(13) |
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.
Use AS_AVAILABLE_IOS_TVOS(13,13)
2c29705
to
11e5992
Compare
11e5992
to
5a207b5
Compare
@@ -27,6 +28,22 @@ NS_ASSUME_NONNULL_BEGIN | |||
* | |||
* @return The rendered image. You can also render intermediary images using UIGraphicsGetImageFromCurrentImageContext. | |||
*/ | |||
AS_EXTERN UIImage *ASGraphicsCreateImageWithOptions(CGSize size, BOOL opaque, CGFloat scale, UIImage * _Nullable sourceImage, asdisplaynode_iscancelled_block_t NS_NOESCAPE _Nullable isCancelled, void (NS_NOESCAPE ^work)()); | |||
AS_EXTERN UIImage *ASGraphicsCreateImageWithOptions(CGSize size, BOOL opaque, CGFloat scale, UIImage * _Nullable sourceImage, asdisplaynode_iscancelled_block_t NS_NOESCAPE _Nullable isCancelled, void (NS_NOESCAPE ^work)(void)); |
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.
Should we deprecate? There is ASDISPLAYNODE_DEPRECATED_MSG
which can be used here
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 think it is appropriate to deprecate since it the existing interface is insufficient for correctness.
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.
Just talked to @vovasty and we'll deprecate in a follow-up PR
ASGraphicsCreateImageWithOptions
uses global trait collection cause it runs in the background, thus colors, etc. inwork
block might receive wrong trait collection (e.g. switching dark/light mode when app in the background).ASGraphicsCreateImageWithTraitCollectionAndOptions
solves this problem by taking a trait collection as a parameter and running a drawing code inside of[[UITraitCollection -performAsCurrentTraitCollection:]