Skip to content

Commit a4d4329

Browse files
huntiefacebook-github-bot
authored andcommitted
Tweak Dev Menu appearance for iOS 26 (#53844)
Summary: Pull Request resolved: #53844 Small UI tweaks that help when scanning more visually spread out alert actions on iOS 26. - Use bold (iOS 26 style) alert title. - Differentiate "Cancel" actions with red system style. Changelog: [Internal] Reviewed By: christophpurrer Differential Revision: D82731784 fbshipit-source-id: 0a0215fc75a4832e742e22328d5e21eee3808972
1 parent 7fb90c3 commit a4d4329

1 file changed

Lines changed: 18 additions & 8 deletions

File tree

packages/react-native/React/CoreModules/RCTDevMenu.mm

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -365,11 +365,14 @@ - (void)setDefaultJSBundle
365365
handler:^(__unused UIAlertAction *action) {
366366
[weakSelf setDefaultJSBundle];
367367
}]];
368-
[alertController addAction:[UIAlertAction actionWithTitle:@"Cancel"
369-
style:UIAlertActionStyleCancel
370-
handler:^(__unused UIAlertAction *action) {
371-
return;
372-
}]];
368+
UIAlertAction *configCancelAction =
369+
[UIAlertAction actionWithTitle:@"Cancel"
370+
style:UIAlertActionStyleCancel
371+
handler:^(__unused UIAlertAction *action) {
372+
return;
373+
}];
374+
[configCancelAction setValue:[UIColor systemRedColor] forKey:@"titleTextColor"];
375+
[alertController addAction:configCancelAction];
373376
[RCTPresentedViewController() presentViewController:alertController animated:YES completion:NULL];
374377
}]];
375378

@@ -390,6 +393,11 @@ - (void)setDefaultJSBundle
390393

391394
_actionSheet = [UIAlertController alertControllerWithTitle:@"React Native Dev Menu" message:nil preferredStyle:style];
392395

396+
NSAttributedString *title =
397+
[[NSAttributedString alloc] initWithString:@"React Native Dev Menu"
398+
attributes:@{NSFontAttributeName : [UIFont boldSystemFontOfSize:17]}];
399+
[_actionSheet setValue:title forKey:@"_attributedTitle"];
400+
393401
NSArray<RCTDevMenuItem *> *items = [self _menuItemsToPresent];
394402
for (RCTDevMenuItem *item in items) {
395403
UIAlertAction *action = [UIAlertAction actionWithTitle:item.title
@@ -399,9 +407,11 @@ - (void)setDefaultJSBundle
399407
[_actionSheet addAction:action];
400408
}
401409

402-
[_actionSheet addAction:[UIAlertAction actionWithTitle:@"Cancel"
403-
style:UIAlertActionStyleCancel
404-
handler:[self alertActionHandlerForDevItem:nil]]];
410+
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel"
411+
style:UIAlertActionStyleCancel
412+
handler:[self alertActionHandlerForDevItem:nil]];
413+
[cancelAction setValue:[UIColor systemRedColor] forKey:@"titleTextColor"];
414+
[_actionSheet addAction:cancelAction];
405415

406416
_presentedItems = items;
407417
[RCTPresentedViewController() presentViewController:_actionSheet animated:YES completion:nil];

0 commit comments

Comments
 (0)