Skip to content
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
6 changes: 3 additions & 3 deletions Libraries/Image/RCTAnimatedImage.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ - (instancetype)initWithData:(NSData *)data scale:(CGFloat)scale

_imageSource = imageSource;

#if TARGET_OS_OSX // [TODO(macOS ISS#2323203)
self = [super initWithData:data];
#else // ]TODO(macOS ISS#2323203)
// grab image at the first index
UIImage *image = [self animatedImageFrameAtIndex:0];
if (!image) {
return nil;
}
#if TARGET_OS_OSX // [TODO(macOS ISS#2323203)
self = [image copy];
#else // ]TODO(macOS ISS#2323203)
self = [super initWithCGImage:image.CGImage scale:MAX(scale, 1) orientation:image.imageOrientation];

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveMemoryWarning:) name:UIApplicationDidReceiveMemoryWarningNotification object:nil];
Expand Down
11 changes: 5 additions & 6 deletions Libraries/Image/RCTUIImageViewAnimated.m
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ - (void)setImage:(UIImage *)image
return;
}

#if !TARGET_OS_OSX // TODO(macOS ISS#2323203)
#if TARGET_OS_OSX
[super setImage:image];
#else // TODO(macOS ISS#2323203)
[self stop];
#endif // TODO(macOS ISS#2323203)

[self resetAnimatedImage];

if ([image respondsToSelector:@selector(animatedImageFrameAtIndex:)]) {
Expand All @@ -116,19 +116,18 @@ - (void)setImage:(UIImage *)image
self.frameBuffer[@(self.currentFrameIndex)] = self.currentFrame;
dispatch_semaphore_signal(self.lock);

#if !TARGET_OS_OSX // TODO(macOS ISS#2323203)
// Calculate max buffer size
[self calculateMaxBufferCount];

if ([self paused]) {
[self start];
}
#endif // TODO(macOS ISS#2323203)


[self.layer setNeedsDisplay];
} else {
super.image = image;
}
#endif // TODO(macOS ISS#2323203)
}

#pragma mark - Private
Expand Down
2 changes: 1 addition & 1 deletion RNTester/js/examples/Image/ImageExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ exports.examples = [
/>
);
},
platform: 'ios',
platform: ['ios', 'macos'], // TODO(OSS Candidate ISS#2710739)
},
{
title: 'Base64 image',
Expand Down