Skip to content

Commit

Permalink
Fix "paused on debugger" overlay icon (#48736)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #48736

Pull Request resolved: #48735

This icon was broken by D65457771, identified in [OSS testing for the 0.77 release](reactwg/react-native-releases#724).

By explicitly setting the image for the `Disabled` state to the same as `Normal`, we get the same behaviour as the deprecated [`adjustsImageWhenDisabled = NO`](https://developer.apple.com/documentation/uikit/uibutton/adjustsimagewhendisabled?language=objc) without the need for `configurationUpdateHandler`.

Changelog: [iOS][Fixed] Restore "Paused in debugger" overlay icon

Reviewed By: cipolleschi

Differential Revision: D68274336

fbshipit-source-id: 3f4b84eb7cfb518ca953c721da9885df8f98b437
  • Loading branch information
robhogan authored and facebook-github-bot committed Jan 16, 2025
1 parent 6fa4cc6 commit f30c46e
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,11 @@ - (void)viewDidLoad
]];

UIButton *resumeButton = [UIButton buttonWithType:UIButtonTypeCustom];
[resumeButton setImage:[UIImage systemImageNamed:@"forward.frame.fill"] forState:UIControlStateNormal];
UIImage *image = [UIImage systemImageNamed:@"forward.frame.fill"];
[resumeButton setImage:image forState:UIControlStateNormal];
[resumeButton setImage:image forState:UIControlStateDisabled];
resumeButton.tintColor = [UIColor colorWithRed:0.37 green:0.37 blue:0.37 alpha:1];

resumeButton.configurationUpdateHandler = ^(UIButton *button) {
button.imageView.tintAdjustmentMode = UIViewTintAdjustmentModeNormal;
};

resumeButton.enabled = NO;
[NSLayoutConstraint activateConstraints:@[
[resumeButton.widthAnchor constraintEqualToConstant:48],
Expand Down

0 comments on commit f30c46e

Please sign in to comment.