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

Merge react-native-svg PR #1494 into this fork #1

Merged
merged 8 commits into from
Jan 26, 2021

Conversation

amgleitman
Copy link
Member

(copied from original PR)

Summary

This adds macOS support to react-native-svg.

A good amount of code for react-native-svg iOS, such as constructing paths, is already platform-agnostic, but there were a few big things that needed to be resolved, mostly related to type differences between macOS and iOS (for example, importing <UIKIt/UIKit.h> and differences between NSView/UIView, NSColor/UIColor, etc.), as well as a couple of iOS concepts that don't appear to have direct macOS equivalent (like -[UIView tintColor], which we use to determine what "currentColor" is).

Most of the heavy lifting in resolving platform differences lies in RNSVGUIKit.h, which is a similar strategy to what react-native-macos does with RCTUIKit.h (found here).

Test Plan

To verify that nothing broke, I created a test app and confirmed that the example SVGs shown in this repo's README render exactly the same.

Screenshot Comparison

macOS iOS
Screen Shot 2020-11-30 at 2 19 38 PM Screen Shot 2020-11-30 at 2 32 06 PM
Screen Shot 2020-11-30 at 2 28 50 PM Screen Shot 2020-11-30 at 2 32 13 PM
Screen Shot 2020-11-30 at 2 29 42 PM Screen Shot 2020-11-30 at 2 32 58 PM
Screen Shot 2020-11-30 at 2 30 33 PM Screen Shot 2020-11-30 at 2 33 04 PM
Screen Shot 2020-11-30 at 2 30 41 PM Screen Shot 2020-11-30 at 2 33 09 PM

Compatibility

OS Implemented
iOS N/A
Android N/A
macOS

Checklist

  • I have tested this on a device and a simulator
  • I added documentation in README.md
  • I updated the typed files (typescript)
  • I added a test for the API in the __tests__ folder

@amgleitman amgleitman merged commit e5c9659 into microsoft:develop Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant