Skip to content

Commit c2e966d

Browse files
Saadnajmipull[bot]ryanlntnntremganandraj
authored
RCTSwitch: Use NSSwitch instead of NSButton (#924)
* add pull yml * match handleOpenURLNotification event payload with iOS (#755) (#2) Co-authored-by: Ryan Linton <ryanlntn@gmail.com> * [pull] master from microsoft:master (#11) * Deprecated api (#853) * Remove deprecated/unused context param * Update a few Mac deprecated APIs * Packing RN dependencies, hermes and ignoring javadoc failure, (#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 (#855) * add pull yml * match handleOpenURLNotification event payload with iOS (#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. (#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>
1 parent 643b056 commit c2e966d

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

React/Views/RCTSwitch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#if !TARGET_OS_OSX // TODO(macOS GH#774)
1313
@interface RCTSwitch : UISwitch
1414
#else // [TODO(macOS GH#774)
15-
@interface RCTSwitch : NSButton
15+
@interface RCTSwitch : NSSwitch
1616
#endif // ]TODO(macOS GH#774)
1717

1818
#if !TARGET_OS_OSX // TODO(macOS GH#774)

React/Views/RCTSwitch.m

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,10 @@
77

88
#import "RCTSwitch.h"
99

10-
#if TARGET_OS_OSX // [TODO(macOS GH#774)
11-
#import <QuartzCore/QuartzCore.h>
12-
#endif // ]TODO(macOS GH#774)
13-
1410
#import "UIView+React.h"
1511

1612
@implementation RCTSwitch
1713

18-
#if TARGET_OS_OSX // [TODO(macOS GH#774)
19-
- (instancetype)initWithFrame:(CGRect)frame
20-
{
21-
if ((self = [super initWithFrame:frame])) {
22-
self.buttonType = NSButtonTypeSwitch;
23-
self.title = @""; // default is "Button"
24-
}
25-
return self;
26-
}
27-
#endif
28-
2914
#if !TARGET_OS_OSX // TODO(macOS GH#774)
3015
- (void)setOn:(BOOL)on animated:(BOOL)animated
3116
{

0 commit comments

Comments
 (0)