mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-06-16 21:50:57 +00:00
Fix race condition that could cause safe area insets to be missing
This commit is contained in:
@@ -14,7 +14,6 @@
|
|||||||
|
|
||||||
@implementation SettingsViewController {
|
@implementation SettingsViewController {
|
||||||
NSInteger _bitrate;
|
NSInteger _bitrate;
|
||||||
Boolean _adjustedForSafeArea;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@dynamic overrideUserInterfaceStyle;
|
@dynamic overrideUserInterfaceStyle;
|
||||||
@@ -89,9 +88,12 @@ static const int bitrateTable[] = {
|
|||||||
self.scrollView.contentSize = CGSizeMake(self.scrollView.contentSize.width,
|
self.scrollView.contentSize = CGSizeMake(self.scrollView.contentSize.width,
|
||||||
highestViewY + 20);
|
highestViewY + 20);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Adjust the subviews for the safe area on the iPhone X.
|
// Adjust the subviews for the safe area on the iPhone X.
|
||||||
if (!_adjustedForSafeArea) {
|
- (void)viewSafeAreaInsetsDidChange {
|
||||||
|
[super viewSafeAreaInsetsDidChange];
|
||||||
|
|
||||||
if (@available(iOS 11.0, *)) {
|
if (@available(iOS 11.0, *)) {
|
||||||
for (UIView* view in self.view.subviews) {
|
for (UIView* view in self.view.subviews) {
|
||||||
// HACK: The official safe area is much too large for our purposes
|
// HACK: The official safe area is much too large for our purposes
|
||||||
@@ -102,9 +104,6 @@ static const int bitrateTable[] = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_adjustedForSafeArea = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)viewDidLoad {
|
- (void)viewDidLoad {
|
||||||
|
|||||||
Reference in New Issue
Block a user