Skip to content

Commit 7bfa51f

Browse files
authored
Add back macOS tintColor implementation (react#1802)
1 parent 2737be3 commit 7bfa51f

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Libraries/Image/RCTImageView.mm

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,28 @@ - (void)didMoveToWindow
653653
[self reloadImage];
654654
}
655655
}
656+
657+
#if TARGET_OS_OSX // [macOS
658+
- (void)windowDidChangeBackingProperties:(NSNotification *)notification
659+
{
660+
[self reloadImage];
661+
}
662+
663+
- (RCTPlatformView *)reactAccessibilityElement
664+
{
665+
return _imageView;
666+
}
667+
668+
- (NSColor *)tintColor
669+
{
670+
return _imageView.contentTintColor;
671+
}
672+
673+
- (void)setTintColor:(NSColor *)tintColor
674+
{
675+
_imageView.contentTintColor = tintColor;
676+
}
677+
#endif // macOS]
656678

657679
- (void)dealloc
658680
{

0 commit comments

Comments
 (0)