@@ -85,13 +85,13 @@ - (void)viewDidLoad
85
85
#if !TARGET_OS_OSX // [macOS]
86
86
UIStackView *stackView = [[UIStackView alloc ] initWithArrangedSubviews: @[ messageContainer, resumeButton ]];
87
87
stackView.backgroundColor = [UIColor colorWithRed: 1 green: 1 blue: 0.757 alpha: 1 ];
88
- stackView.axis = UILayoutConstraintAxisHorizontal;
89
- stackView.distribution = UIStackViewDistributionFill;
90
- stackView.alignment = UIStackViewAlignmentCenter;
91
88
stackView.layer .cornerRadius = 12 ;
92
89
stackView.layer .borderWidth = 2 ;
93
90
stackView.layer .borderColor = [UIColor colorWithRed: 0.71 green: 0.71 blue: 0.62 alpha: 1 ].CGColor ;
94
91
stackView.translatesAutoresizingMaskIntoConstraints = NO ;
92
+ stackView.axis = UILayoutConstraintAxisHorizontal;
93
+ stackView.distribution = UIStackViewDistributionFill;
94
+ stackView.alignment = UIStackViewAlignmentCenter;
95
95
96
96
UITapGestureRecognizer *gestureRecognizer = [[UITapGestureRecognizer alloc ] initWithTarget: self
97
97
action: @selector (handleResume: )];
@@ -101,10 +101,10 @@ - (void)viewDidLoad
101
101
NSStackView *stackView = [NSStackView stackViewWithViews: @[ messageContainer, resumeButton ]];
102
102
stackView.wantsLayer = YES ;
103
103
stackView.layer .backgroundColor = [NSColor colorWithRed: 1 green: 1 blue: 0.757 alpha: 1 ].CGColor ;
104
+ stackView.translatesAutoresizingMaskIntoConstraints = NO ;
104
105
stackView.orientation = NSUserInterfaceLayoutOrientationHorizontal;
105
106
stackView.distribution = NSStackViewDistributionFill;
106
107
stackView.alignment = NSLayoutAttributeCenterY;
107
- stackView.translatesAutoresizingMaskIntoConstraints = NO ;
108
108
109
109
NSClickGestureRecognizer *gestureRecognizer = [[NSClickGestureRecognizer alloc ] initWithTarget: self
110
110
action: @selector (handleResume: )];
@@ -116,11 +116,7 @@ - (void)viewDidLoad
116
116
117
117
[NSLayoutConstraint activateConstraints: @[
118
118
[stackView.topAnchor constraintEqualToAnchor: self .view.safeAreaLayoutGuide.topAnchor constant: 12 ],
119
- [stackView.topAnchor constraintEqualToAnchor: self .view.topAnchor constant: 20 ],
120
- [stackView.leadingAnchor constraintEqualToAnchor: self .view.leadingAnchor constant: 20 ],
121
- [stackView.trailingAnchor constraintEqualToAnchor: self .view.trailingAnchor constant: -20 ],
122
- [stackView.bottomAnchor constraintEqualToAnchor: self .view.bottomAnchor constant: -20 ],
123
- [stackView.centerXAnchor constraintEqualToAnchor: self .view.centerXAnchor],
119
+ [stackView.centerXAnchor constraintEqualToAnchor: self .view.safeAreaLayoutGuide.centerXAnchor],
124
120
]];
125
121
#else
126
122
[self setView: stackView];
@@ -199,8 +195,8 @@ - (void)hide
199
195
{
200
196
#if !TARGET_OS_OSX // [macOS]
201
197
[_alertWindow setHidden: YES ];
198
+
202
199
_alertWindow.windowScene = nil ;
203
- _alertWindow = nil ;
204
200
#else // [macOS]
205
201
NSWindow *parentWindow = RCTKeyWindow ();
206
202
if (parentWindow) {
@@ -211,8 +207,9 @@ - (void)hide
211
207
}
212
208
}
213
209
}
214
- _alertWindow = nil ;
215
210
#endif // macOS]
211
+
212
+ _alertWindow = nil ;
216
213
}
217
214
218
215
@end
0 commit comments