refactor: introduce RCTPlatformImage (1/2)
#2783
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
This PR is split out from #2766 to help make it smaller.
Previously we had the code
@compatibility_alias UIImage NSImagewhich is basically an objective C runtime way of doing#define UIImage NSImage. We don't quite like this, since we are defining the symbolUIImagein an Appkit context. We have a better pattern we can copy from RCTPlatformView --> RCTPlatformImage. TheRCTPlatformprefix basically means it's NS on Appkit and UI on UIKit. This is as opposed to something like RCTUIView, where on iOS it's a typedef, but on macOS it's a subclass that adds stuff to NSView to make it more compatible with UIView.All in all, this should mostly be a rigorous find/replace to make the code slightly more strict, but have no behavioral changes
Test Plan:
RNTester runs locally.