Skip to content

Commit 7361b16

Browse files
Saadnajmitido64
andauthored
Bump minimum macOS requirement to 11.0 (microsoft#2170)
* Bump macOS minimum OS requirement to 11.0 * Update README.md Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> * Update RCTUIKit.m --------- Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com>
1 parent 6d4a0b1 commit 7361b16

12 files changed

Lines changed: 68 additions & 94 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Follow the [Getting Started guide](https://reactnative.dev/docs/getting-started)
6363

6464
## Requirements
6565

66-
You can run React Native for macOS apps on Mac devices with versions Catalina (10.15) or newer.
66+
You can run React Native for macOS apps on Mac devices with versions Big Sur (11) or newer.
6767

6868
For a full and detailed list of the system requirements and how to set up your development platform, see our [System Requirements](https://microsoft.github.io/react-native-windows/docs/rnm-dependencies) documentation on our website.
6969

packages/react-native/Libraries/Text/RCTTextAttributes.mm

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@ @implementation RCTTextAttributes
2020
// [macOS
2121
+ (RCTUIColor *)defaultForegroundColor
2222
{
23-
if (@available(iOS 13.0, *)) {
24-
return [RCTUIColor labelColor];
25-
} else {
26-
return [RCTUIColor blackColor];
27-
}
23+
return [RCTUIColor labelColor];
2824
}
2925
// macOS]
3026

@@ -141,7 +137,7 @@ - (NSParagraphStyle *)effectiveParagraphStyle
141137
}
142138

143139
if (_lineBreakStrategy != NSLineBreakStrategyNone) {
144-
if (@available(iOS 14.0, macOS 11.0, *)) { // [macOS]
140+
if (@available(iOS 14.0, *)) {
145141
paragraphStyle.lineBreakStrategy = _lineBreakStrategy;
146142
isParagraphStyleUsed = YES;
147143
}

packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.mm

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -966,16 +966,8 @@ - (void)handleInputAccessoryDoneButton
966966
NSMutableDictionary<NSAttributedStringKey, id> *textAttributes =
967967
[backedTextInputView.defaultTextAttributes mutableCopy] ?: [NSMutableDictionary new];
968968

969-
if (@available(iOS 13.0, *)) {
970-
[textAttributes setValue:backedTextInputView.placeholderColor ?: [RCTUIColor placeholderTextColor]
971-
forKey:NSForegroundColorAttributeName];
972-
} else {
973-
if (backedTextInputView.placeholderColor) {
974-
[textAttributes setValue:backedTextInputView.placeholderColor forKey:NSForegroundColorAttributeName];
975-
} else {
976-
[textAttributes removeObjectForKey:NSForegroundColorAttributeName];
977-
}
978-
}
969+
[textAttributes setValue:backedTextInputView.placeholderColor ?: [RCTUIColor placeholderTextColor]
970+
forKey:NSForegroundColorAttributeName];
979971

980972
return textAttributes;
981973
}

packages/react-native/Libraries/Text/TextInput/Singleline/RCTUITextField.mm

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -417,18 +417,8 @@ - (void)setSecureTextEntry:(BOOL)secureTextEntry
417417
NSMutableDictionary<NSAttributedStringKey, id> *textAttributes =
418418
[_defaultTextAttributes mutableCopy] ?: [NSMutableDictionary new];
419419

420-
// [macOS
421-
if (@available(iOS 13.0, *)) {
422420
[textAttributes setValue:self.placeholderColor ?: [RCTUIColor placeholderTextColor]
423-
forKey:NSForegroundColorAttributeName];
424-
} else {
425-
// macOS]
426-
if (self.placeholderColor) {
427-
[textAttributes setValue:self.placeholderColor forKey:NSForegroundColorAttributeName];
428-
} else {
429-
[textAttributes removeObjectForKey:NSForegroundColorAttributeName];
430-
}
431-
}
421+
forKey:NSForegroundColorAttributeName]; // [macOS]
432422

433423
return textAttributes;
434424
}

packages/react-native/React/Base/RCTConvert.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ + (NSLocale *)NSLocale:(id)json
377377

378378
+ (NSLineBreakStrategy)NSLineBreakStrategy:(id)json RCT_DYNAMIC
379379
{
380-
if (@available(iOS 14.0, macOS 11.0, *)) { // [macOS]
380+
if (@available(iOS 14.0, *)) {
381381
static NSDictionary *mapping;
382382
static dispatch_once_t onceToken;
383383
dispatch_once(&onceToken, ^{

packages/react-native/React/Base/macOS/RCTUIKit.m

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -886,11 +886,7 @@ - (void)setActivityIndicatorViewStyle:(UIActivityIndicatorViewStyle)activityIndi
886886

887887
switch (activityIndicatorViewStyle) {
888888
case UIActivityIndicatorViewStyleLarge:
889-
if (@available(macOS 11.0, *)) {
890-
self.controlSize = NSControlSizeLarge;
891-
} else {
892-
self.controlSize = NSControlSizeRegular;
893-
}
889+
self.controlSize = NSControlSizeLarge;
894890
break;
895891
case UIActivityIndicatorViewStyleMedium:
896892
self.controlSize = NSControlSizeRegular;

packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextPrimitivesConversions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ inline static NSLineBreakStrategy RCTNSLineBreakStrategyFromLineBreakStrategy(
4949
case facebook::react::LineBreakStrategy::PushOut:
5050
return NSLineBreakStrategyPushOut;
5151
case facebook::react::LineBreakStrategy::HangulWordPriority:
52-
if (@available(iOS 14.0, macOS 11.0, *)) { // [macOS]
52+
if (@available(iOS 14.0, *)) {
5353
return NSLineBreakStrategyHangulWordPriority;
5454
} else {
5555
return NSLineBreakStrategyNone;
5656
}
5757
case facebook::react::LineBreakStrategy::Standard:
58-
if (@available(iOS 14.0, macOS 11.0, *)) { // [macOS]
58+
if (@available(iOS 14.0, *)) {
5959
return NSLineBreakStrategyStandard;
6060
} else {
6161
return NSLineBreakStrategyNone;

packages/react-native/local-cli/generator-macos/templates/macos/HelloWorld.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@
352352
DEAD_CODE_STRIPPING = NO;
353353
INFOPLIST_FILE = "HelloWorld-macos/Info.plist";
354354
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
355-
MACOSX_DEPLOYMENT_TARGET = 10.15;
355+
MACOSX_DEPLOYMENT_TARGET = 11.0;
356356
OTHER_LDFLAGS = (
357357
"$(inherited)",
358358
"-ObjC",
@@ -374,7 +374,7 @@
374374
CURRENT_PROJECT_VERSION = 1;
375375
INFOPLIST_FILE = "HelloWorld-macos/Info.plist";
376376
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
377-
MACOSX_DEPLOYMENT_TARGET = 10.15;
377+
MACOSX_DEPLOYMENT_TARGET = 11.0;
378378
OTHER_LDFLAGS = (
379379
"$(inherited)",
380380
"-ObjC",

packages/react-native/local-cli/generator-macos/templates/macos/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ require_relative '../node_modules/@react-native-community/cli-platform-ios/nativ
44
prepare_react_native_project!
55

66
target 'HelloWorld-macOS' do
7-
platform :macos, '10.15'
7+
platform :macos, '11.0'
88
use_native_modules!
99

1010
# Flags change depending on the env values.

packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def min_ios_version_supported
2626

2727
# [macOS
2828
def min_macos_version_supported
29-
return '10.15'
29+
return '11.0'
3030
end
3131
# macOS]
3232

@@ -524,7 +524,7 @@ def get_podspec_no_fabric_no_script
524524
'header_mappings_dir' => './',
525525
'platforms' => {
526526
:ios => '13.4',
527-
'osx' => '10.15',
527+
:osx => '11.0',
528528
},
529529
'source_files' => "**/*.{h,mm,cpp}",
530530
'pod_target_xcconfig' => {

0 commit comments

Comments
 (0)