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

Add support for tintColor on ASImageNode and ASButtonNode #1603

Merged
merged 8 commits into from
Aug 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions AsyncDisplayKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
8021EC1D1D2B00B100799119 /* UIImage+ASConvenience.h in Headers */ = {isa = PBXBuildFile; fileRef = 8021EC1A1D2B00B100799119 /* UIImage+ASConvenience.h */; settings = {ATTRIBUTES = (Public, ); }; };
8021EC1F1D2B00B100799119 /* UIImage+ASConvenience.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8021EC1B1D2B00B100799119 /* UIImage+ASConvenience.mm */; };
81E95C141D62639600336598 /* ASTextNodeSnapshotTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 81E95C131D62639600336598 /* ASTextNodeSnapshotTests.mm */; };
81FF150722EB5F410039311A /* ASButtonNodeSnapshotTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 81FF150622EB5F410039311A /* ASButtonNodeSnapshotTests.mm */; };
83A7D95B1D44547700BF333E /* ASWeakMap.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83A7D9591D44542100BF333E /* ASWeakMap.mm */; };
83A7D95C1D44548100BF333E /* ASWeakMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 83A7D9581D44542100BF333E /* ASWeakMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
83A7D95E1D446A6E00BF333E /* ASWeakMapTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83A7D95D1D446A6E00BF333E /* ASWeakMapTests.mm */; };
Expand Down Expand Up @@ -747,6 +748,7 @@
81E95C131D62639600336598 /* ASTextNodeSnapshotTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASTextNodeSnapshotTests.mm; sourceTree = "<group>"; };
81EE384D1C8E94F000456208 /* ASRunLoopQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASRunLoopQueue.h; path = ../ASRunLoopQueue.h; sourceTree = "<group>"; };
81EE384E1C8E94F000456208 /* ASRunLoopQueue.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASRunLoopQueue.mm; path = ../ASRunLoopQueue.mm; sourceTree = "<group>"; };
81FF150622EB5F410039311A /* ASButtonNodeSnapshotTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ASButtonNodeSnapshotTests.mm; sourceTree = "<group>"; };
83A7D9581D44542100BF333E /* ASWeakMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASWeakMap.h; sourceTree = "<group>"; };
83A7D9591D44542100BF333E /* ASWeakMap.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASWeakMap.mm; sourceTree = "<group>"; };
83A7D95D1D446A6E00BF333E /* ASWeakMapTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASWeakMapTests.mm; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1297,23 +1299,22 @@
058D09C5195D04C000B7D73C /* Tests */ = {
isa = PBXGroup;
children = (
9692B4FE219E12370060C2C3 /* ASCollectionViewThrashTests.mm */,
F325E48F217460B000AC93A4 /* ASTextNode2Tests.mm */,
F325E48B21745F9E00AC93A4 /* ASButtonNodeTests.mm */,
F3F698D1211CAD4600800CB1 /* ASDisplayViewAccessibilityTests.mm */,
DBC452DD1C5C6A6A00B16017 /* ArrayDiffingTests.mm */,
AC026B571BD3F61800BBC17E /* ASAbsoluteLayoutSpecSnapshotTests.mm */,
696FCB301D6E46050093471E /* ASBackgroundLayoutSpecSnapshotTests.mm */,
29CDC2E11AAE70D000833CA4 /* ASBasicImageDownloaderContextTests.mm */,
242995D21B29743C00090100 /* ASBasicImageDownloaderTests.mm */,
296A0A341A951ABF005ACEAA /* ASBatchFetchingTests.mm */,
CC3B208F1C3F892D00798563 /* ASBridgedPropertiesTests.mm */,
F325E48B21745F9E00AC93A4 /* ASButtonNodeTests.mm */,
81FF150622EB5F410039311A /* ASButtonNodeSnapshotTests.mm */,
CC051F1E1D7A286A006434CB /* ASCALayerTests.mm */,
ACF6ED531B178DC700DA7C62 /* ASCenterLayoutSpecSnapshotTests.mm */,
CCDD148A1EEDCD9D0020834E /* ASCollectionModernDataSourceTests.mm */,
CC35CEC520DD87280006448D /* ASCollectionsTests.mm */,
2538B6F21BC5D2A2003CA0B4 /* ASCollectionViewFlowLayoutInspectorTests.mm */,
9F06E5CC1B4CAF4200F015D8 /* ASCollectionViewTests.mm */,
9692B4FE219E12370060C2C3 /* ASCollectionViewThrashTests.mm */,
CCEDDDD8200C518800FFCD0A /* ASConfigurationTests.mm */,
2911485B1A77147A005D0878 /* ASControlNodeTests.mm */,
1A6C000F1FAB4ED400D05926 /* ASCornerLayoutSpecSnapshotTests.mm */,
Expand All @@ -1328,6 +1329,7 @@
058D0A2F195D057000B7D73C /* ASDisplayNodeTests.mm */,
058D0A30195D057000B7D73C /* ASDisplayNodeTestsHelper.h */,
058D0A31195D057000B7D73C /* ASDisplayNodeTestsHelper.mm */,
F3F698D1211CAD4600800CB1 /* ASDisplayViewAccessibilityTests.mm */,
697B31591CFE4B410049936F /* ASEditableTextNodeTests.mm */,
471D04B0224CB98600649215 /* ASImageNodeBackingSizeTests.mm */,
056D21541ABCEF50001107EF /* ASImageNodeSnapshotTests.mm */,
Expand Down Expand Up @@ -1366,6 +1368,7 @@
254C6B531BF8FF2A003EC431 /* ASTextKitTests.mm */,
254C6B511BF8FE6D003EC431 /* ASTextKitTruncationTests.mm */,
C057D9BC20B5453D00FC9112 /* ASTextNode2SnapshotTests.mm */,
F325E48F217460B000AC93A4 /* ASTextNode2Tests.mm */,
CC8B05D71D73979700F54286 /* ASTextNodePerformanceTests.mm */,
81E95C131D62639600336598 /* ASTextNodeSnapshotTests.mm */,
058D0A36195D057000B7D73C /* ASTextNodeTests.mm */,
Expand All @@ -1374,13 +1377,13 @@
9644CFDF2193777C00213478 /* ASThrashUtility.m */,
CCE4F9BC1F0ECE5200062E4E /* ASTLayoutFixture.h */,
CCE4F9BD1F0ECE5200062E4E /* ASTLayoutFixture.mm */,
D933F040224AD17F00FF495E /* ASTransactionTests.mm */,
CC0AEEA31D66316E005D1C78 /* ASUICollectionViewTests.mm */,
AEEC47E31C21D3D200EC1693 /* ASVideoNodeTests.mm */,
CCA221D21D6FA7EF00AF6A0F /* ASViewControllerTests.mm */,
83A7D95D1D446A6E00BF333E /* ASWeakMapTests.mm */,
CC3B208D1C3F7D0A00798563 /* ASWeakSetTests.mm */,
695BE2541DC1245C008E6EA5 /* ASWrapperSpecSnapshotTests.mm */,
D933F040224AD17F00FF495E /* ASTransactionTests.mm */,
057D02C01AC0A66700C7AC3C /* AsyncDisplayKitTestHost */,
CC583ABF1EF9BAB400134156 /* Common */,
058D09C6195D04C000B7D73C /* Supporting Files */,
Expand Down Expand Up @@ -2293,6 +2296,7 @@
CC3B208E1C3F7D0A00798563 /* ASWeakSetTests.mm in Sources */,
F711994E1D20C21100568860 /* ASDisplayNodeExtrasTests.mm in Sources */,
BB5FC3CE1F9BA689007F191E /* ASNavigationControllerTests.mm in Sources */,
81FF150722EB5F410039311A /* ASButtonNodeSnapshotTests.mm in Sources */,
ACF6ED5D1B178DC700DA7C62 /* ASDimensionTests.mm in Sources */,
BB5FC3D11F9C9389007F191E /* ASTabBarControllerTests.mm in Sources */,
695BE2551DC1245C008E6EA5 /* ASWrapperSpecSnapshotTests.mm in Sources */,
Expand Down
36 changes: 23 additions & 13 deletions Source/ASButtonNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ - (instancetype)init
_contentEdgeInsets = UIEdgeInsetsZero;
_imageAlignment = ASButtonNodeImageAlignmentBeginning;
self.accessibilityTraits = self.defaultAccessibilityTraits;

[self updateYogaLayoutIfNeeded];
}
return self;
Expand All @@ -52,12 +52,9 @@ - (ASTextNode *)titleNode
ASLockScopeSelf();
if (!_titleNode) {
_titleNode = [[ASTextNode alloc] init];
#if TARGET_OS_IOS
// tvOS needs access to the underlying view
// of the button node to add a touch handler.
[_titleNode setLayerBacked:YES];
#endif
// Intentionally not layer-backing the image node since tintColor may be applied
_titleNode.style.flexShrink = 1.0;
_titleNode.textColorFollowsTintColor = YES;
}
return _titleNode;
}
Expand All @@ -69,7 +66,7 @@ - (ASImageNode *)imageNode
ASLockScopeSelf();
if (!_imageNode) {
_imageNode = [[ASImageNode alloc] init];
[_imageNode setLayerBacked:YES];
// Intentionally not layer-backing the image node since tintColor may be applied
}
return _imageNode;
}
Expand Down Expand Up @@ -131,6 +128,17 @@ - (void)setDisplaysAsynchronously:(BOOL)displaysAsynchronously
[self.titleNode setDisplaysAsynchronously:displaysAsynchronously];
}

-(void)tintColorDidChange
{
[super tintColorDidChange];
// UIButton documentation states that it tints the image and title of buttons when tintColor is set.
// | "The tint color to apply to the button title and image."
// | From: https://developer.apple.com/documentation/uikit/uibutton/1624025-tintcolor
UIColor *tintColor = self.tintColor;
self.imageNode.tintColor = tintColor;
self.titleNode.tintColor = tintColor;
}

- (void)updateImage
{
[self lock];
Expand Down Expand Up @@ -301,12 +309,14 @@ - (void)setImageAlignment:(ASButtonNodeImageAlignment)imageAlignment
#if TARGET_OS_IOS
- (void)setTitle:(NSString *)title withFont:(UIFont *)font withColor:(UIColor *)color forState:(UIControlState)state
{
NSDictionary *attributes = @{
NSFontAttributeName: font ? : [UIFont systemFontOfSize:[UIFont buttonFontSize]],
NSForegroundColorAttributeName : color ? : [UIColor blackColor]
};

NSAttributedString *string = [[NSAttributedString alloc] initWithString:title attributes:attributes];
NSMutableDictionary *attributes = [NSMutableDictionary dictionary];
attributes[NSFontAttributeName] = font ? : [UIFont systemFontOfSize:[UIFont buttonFontSize]];
if (color != nil) {
// From apple's documentation: If color is not specified, NSForegroundColorAttributeName will fallback to black
// Only set if the color is nonnull
attributes[NSForegroundColorAttributeName] = color;
}
rahul-malik marked this conversation as resolved.
Show resolved Hide resolved
NSAttributedString *string = [[NSAttributedString alloc] initWithString:title attributes:[attributes copy]];
[self setAttributedTitle:string forState:state];
}
#endif
Expand Down
20 changes: 19 additions & 1 deletion Source/ASImageNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ @interface ASImageNodeDrawParameters : NSObject {
CGRect _bounds;
CGFloat _contentsScale;
UIColor *_backgroundColor;
UIColor *_tintColor;
UIViewContentMode _contentMode;
BOOL _cropEnabled;
BOOL _forceUpscaling;
Expand Down Expand Up @@ -69,6 +70,7 @@ @interface ASImageNodeContentsKey : NSObject
@property CGRect imageDrawRect;
@property BOOL isOpaque;
@property (nonatomic, copy) UIColor *backgroundColor;
@property (nonatomic, copy) UIColor *tintColor;
@property (nonatomic) ASDisplayNodeContextModifier willDisplayNodeContentWithRenderingContext;
@property (nonatomic) ASDisplayNodeContextModifier didDisplayNodeContentWithRenderingContext;
@property (nonatomic) asimagenode_modification_block_t imageModificationBlock;
Expand All @@ -94,6 +96,7 @@ - (BOOL)isEqual:(id)object
&& CGRectEqualToRect(_imageDrawRect, other.imageDrawRect)
&& _isOpaque == other.isOpaque
&& [_backgroundColor isEqual:other.backgroundColor]
&& [_tintColor isEqual:other.tintColor]
&& _willDisplayNodeContentWithRenderingContext == other.willDisplayNodeContentWithRenderingContext
&& _didDisplayNodeContentWithRenderingContext == other.didDisplayNodeContentWithRenderingContext
&& _imageModificationBlock == other.imageModificationBlock;
Expand All @@ -112,6 +115,7 @@ - (NSUInteger)hash
CGRect imageDrawRect;
NSInteger isOpaque;
NSUInteger backgroundColorHash;
NSUInteger tintColorHash;
void *willDisplayNodeContentWithRenderingContext;
void *didDisplayNodeContentWithRenderingContext;
void *imageModificationBlock;
Expand All @@ -122,6 +126,7 @@ - (NSUInteger)hash
_imageDrawRect,
_isOpaque,
_backgroundColor.hash,
_tintColor.hash,
(void *)_willDisplayNodeContentWithRenderingContext,
(void *)_didDisplayNodeContentWithRenderingContext,
(void *)_imageModificationBlock
Expand Down Expand Up @@ -296,6 +301,7 @@ - (NSObject *)drawParametersForAsyncLayer:(_ASDisplayLayer *)layer
drawParameters->_opaque = self.opaque;
drawParameters->_contentsScale = _contentsScaleForDisplay;
drawParameters->_backgroundColor = self.backgroundColor;
drawParameters->_tintColor = self.tintColor;
drawParameters->_contentMode = self.contentMode;
drawParameters->_cropEnabled = _imageNodeFlags.cropEnabled;
drawParameters->_forceUpscaling = _imageNodeFlags.forceUpscaling;
Expand Down Expand Up @@ -330,6 +336,7 @@ + (UIImage *)displayWithParameters:(id<NSObject>)parameter isCancelled:(NS_NOESC
BOOL cropEnabled = drawParameter->_cropEnabled;
BOOL isOpaque = drawParameter->_opaque;
UIColor *backgroundColor = drawParameter->_backgroundColor;
UIColor *tintColor = drawParameter->_tintColor;
UIViewContentMode contentMode = drawParameter->_contentMode;
CGFloat contentsScale = drawParameter->_contentsScale;
CGRect cropDisplayBounds = drawParameter->_cropDisplayBounds;
Expand Down Expand Up @@ -401,6 +408,7 @@ + (UIImage *)displayWithParameters:(id<NSObject>)parameter isCancelled:(NS_NOESC
contentsKey.imageDrawRect = imageDrawRect;
contentsKey.isOpaque = isOpaque;
contentsKey.backgroundColor = backgroundColor;
contentsKey.tintColor = tintColor;
contentsKey.willDisplayNodeContentWithRenderingContext = willDisplayNodeContentWithRenderingContext;
contentsKey.didDisplayNodeContentWithRenderingContext = didDisplayNodeContentWithRenderingContext;
contentsKey.imageModificationBlock = imageModificationBlock;
Expand Down Expand Up @@ -499,6 +507,10 @@ + (UIImage *)createContentsForkey:(ASImageNodeContentsKey *)key drawParameters:(
UIImage *image = key.image;
BOOL canUseCopy = (contextIsClean || ASImageAlphaInfoIsOpaque(CGImageGetAlphaInfo(image.CGImage)));
CGBlendMode blendMode = canUseCopy ? kCGBlendModeCopy : kCGBlendModeNormal;
UIImageRenderingMode renderingMode = [image renderingMode];
if (renderingMode == UIImageRenderingModeAlwaysTemplate && key.tintColor) {
[key.tintColor setFill];
}

@synchronized(image) {
[image drawInRect:key.imageDrawRect blendMode:blendMode alpha:1];
Expand All @@ -508,7 +520,13 @@ + (UIImage *)createContentsForkey:(ASImageNodeContentsKey *)key drawParameters:(
key.didDisplayNodeContentWithRenderingContext(context, drawParameters);
}
});


// if the original image was stretchy, keep it stretchy
UIImage *originalImage = key.image;
if (!UIEdgeInsetsEqualToEdgeInsets(originalImage.capInsets, UIEdgeInsetsZero)) {
result = [result resizableImageWithCapInsets:originalImage.capInsets resizingMode:originalImage.resizingMode];
}

if (key.imageModificationBlock) {
result = key.imageModificationBlock(result);
}
Expand Down
6 changes: 6 additions & 0 deletions Source/ASTextNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,12 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (nonatomic) BOOL alwaysHandleTruncationTokenTap;

/**
@abstract if YES will use the value of `self.tintColor` if the foreground color of text is not defined.
@discussion This is mainly used from ASButtonNode since by default text nodes do not respect tintColor settings unless contained within a interactive control
*/
@property (nonatomic) BOOL textColorFollowsTintColor;

@end

@interface ASTextNode (Unavailable)
Expand Down
10 changes: 8 additions & 2 deletions Source/ASTextNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,10 @@ - (instancetype)init
// on the special placeholder behavior of ASTextNode.
_placeholderColor = ASDisplayNodeDefaultPlaceholderColor();
_placeholderInsets = UIEdgeInsetsMake(1.0, 0.0, 1.0, 0.0);

// Tint color is applied when text nodes are within controls and indicate user action
// Most text nodes do not require interaction and this matches the default value of UILabel
_textColorFollowsTintColor = NO;
}

return self;
Expand Down Expand Up @@ -377,7 +381,8 @@ - (ASTextKitAttributes)_locked_rendererAttributes
.shadowOffset = _shadowOffset,
.shadowColor = _cachedShadowUIColor,
.shadowOpacity = _shadowOpacity,
.shadowRadius = _shadowRadius
.shadowRadius = _shadowRadius,
.tintColor = self.textColorFollowsTintColor ? self.tintColor : nil
};
}

Expand Down Expand Up @@ -571,7 +576,8 @@ + (UIImage *)displayWithParameters:(id<NSObject>)parameters isCancelled:(NS_NOES
[backgroundColor setFill];
UIRectFillUsingBlendMode(CGContextGetClipBoundingBox(context), kCGBlendModeCopy);
}



// Draw text
[renderer drawInContext:context bounds:drawParameter->_bounds];
CGContextRestoreGState(context);
Expand Down
6 changes: 6 additions & 0 deletions Source/ASTextNode2.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,12 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (nonatomic) BOOL alwaysHandleTruncationTokenTap;

/**
@abstract if YES will use the value of `self.tintColor` if the foreground color of text is not defined.
@discussion This is mainly used from ASButtonNode since by default text nodes do not respect tintColor settings unless contained within a interactive control
*/
@property (nonatomic) BOOL textColorFollowsTintColor;

+ (void)enableDebugging;

#pragma mark - Layout and Sizing
Expand Down
14 changes: 14 additions & 0 deletions Source/ASTextNode2.mm
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,20 @@ - (void)prepareAttributedString:(NSMutableAttributedString *)attributedString is
shadow.shadowBlurRadius = _shadowRadius;
[attributedString addAttribute:NSShadowAttributeName value:shadow range:NSMakeRange(0, attributedString.length)];
}

// Apply tint color if needed and foreground color is not already specified
if (self.textColorFollowsTintColor) {
// Apply tint color if specified and if foreground color is undefined for attributedString
NSRange limit = NSMakeRange(0, attributedString.length);
NSRange effectiveRange;
// Look for previous attributes that define foreground color
UIColor *attributeValue = (UIColor *)[attributedString attribute:NSForegroundColorAttributeName atIndex:limit.location effectiveRange:&effectiveRange];
UIColor *tintColor = self.tintColor;
if (attributeValue == nil && tintColor) {
// None are found, apply tint color if available. Fallback to "black" text color
[attributedString addAttributes:@{ NSForegroundColorAttributeName : tintColor } range:limit];
}
}
}

#pragma mark - Drawing
Expand Down
4 changes: 1 addition & 3 deletions Source/Private/_ASPendingState.mm
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ ASDISPLAYNODE_INLINE void ASPendingStateApplyMetricsToLayer(_ASPendingState *sta
@synthesize maskedCorners = maskedCorners;

static CGColorRef blackColorRef = NULL;
static UIColor *defaultTintColor = nil;

- (instancetype)init
{
Expand All @@ -244,7 +243,6 @@ - (instancetype)init
blackColorRef = CGColorCreate(colorSpace, (CGFloat[]){0,0,0,1} );
CFRetain(blackColorRef);
CGColorSpaceRelease(colorSpace);
defaultTintColor = [UIColor colorWithRed:0.0 green:0.478 blue:1.0 alpha:1.0];
});

// Set defaults, these come from the defaults specified in CALayer and UIView
Expand All @@ -253,7 +251,7 @@ - (instancetype)init
frame = CGRectZero;
bounds = CGRectZero;
backgroundColor = nil;
tintColor = defaultTintColor;
tintColor = nil;
_flags.hidden = NO;
_flags.needsDisplayOnBoundsChange = NO;
_flags.allowsGroupOpacity = ASDefaultAllowsGroupOpacity();
Expand Down
8 changes: 7 additions & 1 deletion Source/TextKit/ASTextKitAttributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ struct ASTextKitAttributes {
*/
NSArray *pointSizeScaleFactors;

/**
The tint color to use in drawing the text foreground color. Only applied if the attributedString does not define foreground color
*/
UIColor *tintColor;
/**
We provide an explicit copy function so we can use aggregate initializer syntax while providing copy semantics for
the NSObjects inside.
Expand All @@ -102,6 +106,7 @@ struct ASTextKitAttributes {
shadowOpacity,
shadowRadius,
pointSizeScaleFactors,
[tintColor copy]
};
};

Expand All @@ -119,7 +124,8 @@ struct ASTextKitAttributes {
&& ASObjectIsEqual(avoidTailTruncationSet, other.avoidTailTruncationSet)
&& ASObjectIsEqual(shadowColor, other.shadowColor)
&& ASObjectIsEqual(attributedString, other.attributedString)
&& ASObjectIsEqual(truncationAttributedString, other.truncationAttributedString);
&& ASObjectIsEqual(truncationAttributedString, other.truncationAttributedString)
&& ASObjectIsEqual(tintColor, other.tintColor);
}

size_t hash() const;
Expand Down
1 change: 1 addition & 0 deletions Source/TextKit/ASTextKitContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ AS_SUBCLASSING_RESTRICTED
Initialization of TextKit components is a globally locking operation so be careful of bottlenecks with this class.
*/
- (instancetype)initWithAttributedString:(NSAttributedString *)attributedString
tintColor:(UIColor *)tintColor
lineBreakMode:(NSLineBreakMode)lineBreakMode
maximumNumberOfLines:(NSUInteger)maximumNumberOfLines
exclusionPaths:(NSArray *)exclusionPaths
Expand Down
Loading