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

feat: React-Native-MacOS Support #119

Merged
merged 8 commits into from
Sep 7, 2020

Conversation

bralax
Copy link
Contributor

@bralax bralax commented Jul 30, 2020

Summary

I am working on a project using react-native-macos and needed access to a picker, so I decided to implement this library for macOS using the NSPopUpButton.

Test Plan

To test that it worked, I built a small sample application that uses the library.

Here is some screenshots of it in use.
Screen Shot 2020-07-30 at 12 01 33 AM
Screen Shot 2020-07-30 at 12 01 43 AM
Screen Shot 2020-07-30 at 12 02 10 AM

What's required for testing (prerequisites)?

A macOS computer running >= 10.14

What are the steps to reproduce (after prerequisites)?

  1. Clone the sample application -> won't work in a normal repo currently as pod spec does not work as it will always download from this repo
  2. Run yarn
  3. Replace the picker node module with this code
  4. Pod install
  5. Run the code with npx react-native run-macos

Compatibility

OS Implemented
iOS
Android
MacOS

Checklist

  • I have tested this on a device and a simulator
  • I added the documentation in README.md
  • I mentioned this change in CHANGELOG.md -> Does not exist?
  • I updated the typed files (TS and Flow)
  • I added a sample use of the API in the example project (example/App.js) -> Does not currently work as the pod spec relies on this GitHub and the code for macOS is currently not in the pod which is why I made the sample project with a modified pod spec.

macos/RNCPicker.m Outdated Show resolved Hide resolved
macos/RNCPicker.m Outdated Show resolved Hide resolved
macos/RNCPicker.m Outdated Show resolved Hide resolved
Copy link
Contributor

@Naturalclar Naturalclar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bralax Thank you so much!
There were some commented out sections left in the code. Could those be removed or have comments stating the reason for the comment out? Thanks 😄

@bralax
Copy link
Contributor Author

bralax commented Aug 8, 2020

Hi @Naturalclar That was my fault for leaving those in and I have no removed the comments. I was using the IOS implementation as a reference so a lot of that is that as I went I commented out code that did not apply to macOS (for example the macOS equivalent does not use a delegate or datasource) and forgot to delete afterwards.

@bralax bralax requested a review from Naturalclar August 8, 2020 14:37
Copy link
Contributor

@Naturalclar Naturalclar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bralax thank you so much!

@Naturalclar Naturalclar changed the title React-Native-MacOS Support feat: React-Native-MacOS Support Sep 7, 2020
@Naturalclar Naturalclar merged commit ce7d335 into react-native-picker:master Sep 7, 2020
jainkuniya pushed a commit that referenced this pull request Sep 7, 2020
# [1.7.0](v1.6.6...v1.7.0) (2020-09-07)

### Features

* React-Native-MacOS Support ([#119](#119)) ([ce7d335](ce7d335))
@jainkuniya
Copy link
Collaborator

🎉 This PR is included in version 1.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants