Avoid crashing on iOS 11 betas released before iPhone X

This commit is contained in:
Cameron Gutman
2017-12-27 23:24:53 -08:00
parent 3bc9e050f1
commit d7ee0916e9
@@ -1371,9 +1371,16 @@ const int FrontViewPositionNone = 0xff;
// These are derived from the primary view controller // These are derived from the primary view controller
if (@available(iOS 11.0, *)) { if (@available(iOS 11.0, *)) {
// iOS 11 betas (which are still installed in some places :\) crash with
// doesNotRecognizeSelector since this wasn't added until after the iPhone X
// announcement.
if ([self respondsToSelector: @selector(setNeedsUpdateOfHomeIndicatorAutoHidden)]) {
[self setNeedsUpdateOfHomeIndicatorAutoHidden]; [self setNeedsUpdateOfHomeIndicatorAutoHidden];
}
if ([self respondsToSelector: @selector(setNeedsUpdateOfScreenEdgesDeferringSystemGestures)]) {
[self setNeedsUpdateOfScreenEdgesDeferringSystemGestures]; [self setNeedsUpdateOfScreenEdgesDeferringSystemGestures];
} }
}
} }
- (UIViewController*)childViewControllerForHomeIndicatorAutoHidden - (UIViewController*)childViewControllerForHomeIndicatorAutoHidden