-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Add SegmentedControlIOS #564
Add SegmentedControlIOS #564
Conversation
#import "UIView+React.h" | ||
#import "RCTEventDispatcher.h" | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Remove extra line.
Clay, this looks great. I only have a few nit requests but if you can make those edits, we can merge this straightaway. 😃 |
Hm, we should ideally just use |
@ashwinb Good idea. I like that better. The user should be able to set the |
@a2 @ashwinb I went back and forth on this; I figured that, on the JS side, people would be doing the index -> value conversion on every callback to make their logic not dependent on ordering, so we might as well do it for them. I.e.:
vs
maybe a compromise is to 1) allow but my opinion isn't terribly strong, so will defer to your judgement |
Yes, passing both |
I've updated the PR; check out the API examples |
It doesn't patch cleanly anymore, can you rebase? Sorry about this |
06c2d95
to
49ddd7a
Compare
@vjeux done, np |
What's the status of this? |
RCT_EXPORT_VIEW_PROPERTY(tintColor, UIColor); | ||
RCT_EXPORT_VIEW_PROPERTY(momentary, BOOL); | ||
RCT_EXPORT_VIEW_PROPERTY(enabled, BOOL); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs RCT_EXPORT_MODULE(); to work in current version.
Hey, sorry about the radio silence on this. The internal diff sort of got lost in transmission for a while, however the good news is that this has now been merged and will ship with the next release. |
Lovely, thanks! |
* Docs for Appstate I lost whatever pull request that was so I have recreated here in response to issue facebook#564 * Update reason-react-native/src/apis/AppState.md Co-Authored-By: Max Thirouin <git@moox.io>
Fixes #534:
This only supports string-based segments, not images. Also doesn't support full customization (no separator images etc); I figure this is a good MVP to lock-down a basic API
I also included a snapshot test case, but the images keep coming out funky. When I look at the sim, I see that the text labels show up for the selected segment, but the snapshot keeps coming out with no text on those segments. I tried forcing a delay, but same result. Is that explainable?
Obviously happy to change anything about the API, code-style nitpicks, etc