Skip to content

Commit

Permalink
RCTSwitch: Use NSSwitch instead of NSButton (microsoft#924)
Browse files Browse the repository at this point in the history
* add pull yml

* match handleOpenURLNotification event payload with iOS (microsoft#755) (#2)

Co-authored-by: Ryan Linton <ryanlntn@gmail.com>

* [pull] master from microsoft:master (#11)

* Deprecated api (microsoft#853)

* Remove deprecated/unused context param
* Update a few Mac deprecated APIs

* Packing RN dependencies, hermes and ignoring javadoc failure,  (microsoft#852)

* Ignore javadoc failure

* Bringing few more changes from 0.63-stable

* Fixing a patch in engine selection

* Fixing a patch in nuget spec

* Fixing the output directory of nuget pack

* Packaging dependencies in the nuget

* Fix onMouseEnter/onMouseLeave callbacks not firing on Pressable (microsoft#855)

* add pull yml

* match handleOpenURLNotification event payload with iOS (microsoft#755) (#2)

Co-authored-by: Ryan Linton <ryanlntn@gmail.com>

* fix mouse evetns on pressable

* delete extra yml from this branch

* Add macOS tags

* reorder props to have onMouseEnter/onMouseLeave always be before onPress

Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com>
Co-authored-by: Ryan Linton <ryanlntn@gmail.com>

* Grammar fixes. (microsoft#856)

Updates simple grammar issues.

Co-authored-by: Nick Trescases <42704557+ntre@users.noreply.github.com>
Co-authored-by: Anandraj <anandrag@microsoft.com>
Co-authored-by: Saad Najmi <saadnajmi2@gmail.com>
Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com>
Co-authored-by: Ryan Linton <ryanlntn@gmail.com>
Co-authored-by: Muhammad Hamza Zaman <mh.zaman.4069@gmail.com>

* Use NSSwitch

* remove change from my fork

Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com>
Co-authored-by: Ryan Linton <ryanlntn@gmail.com>
Co-authored-by: Nick Trescases <42704557+ntre@users.noreply.github.com>
Co-authored-by: Anandraj <anandrag@microsoft.com>
Co-authored-by: Muhammad Hamza Zaman <mh.zaman.4069@gmail.com>
  • Loading branch information
6 people authored Jan 25, 2022
1 parent 643b056 commit c2e966d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
2 changes: 1 addition & 1 deletion React/Views/RCTSwitch.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#if !TARGET_OS_OSX // TODO(macOS GH#774)
@interface RCTSwitch : UISwitch
#else // [TODO(macOS GH#774)
@interface RCTSwitch : NSButton
@interface RCTSwitch : NSSwitch
#endif // ]TODO(macOS GH#774)

#if !TARGET_OS_OSX // TODO(macOS GH#774)
Expand Down
15 changes: 0 additions & 15 deletions React/Views/RCTSwitch.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,10 @@

#import "RCTSwitch.h"

#if TARGET_OS_OSX // [TODO(macOS GH#774)
#import <QuartzCore/QuartzCore.h>
#endif // ]TODO(macOS GH#774)

#import "UIView+React.h"

@implementation RCTSwitch

#if TARGET_OS_OSX // [TODO(macOS GH#774)
- (instancetype)initWithFrame:(CGRect)frame
{
if ((self = [super initWithFrame:frame])) {
self.buttonType = NSButtonTypeSwitch;
self.title = @""; // default is "Button"
}
return self;
}
#endif

#if !TARGET_OS_OSX // TODO(macOS GH#774)
- (void)setOn:(BOOL)on animated:(BOOL)animated
{
Expand Down

0 comments on commit c2e966d

Please sign in to comment.