/
githubmr
/
facebook-react-native
Обзор
Документация
Войти
/
githubmr
/
facebook-react-native
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
main
packages/react-native/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm
78 строк
2 KB
generatedunixname89002005287564
Fix CQS signal readability-implicit-bool-conversion in xplat/js/react-native-github/packages (#53582)
03 сен 2025, 17:38
03 сен 2025, 17:38
2cd06ad
Код
Авторство
О чём код?
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #import "RCTFabricModalHostViewController.h" #import <React/RCTLog.h> #import <React/RCTSurfaceTouchHandler.h> @implementation RCTFabricModalHostViewController { CGRect _lastViewBounds; RCTSurfaceTouchHandler *_touchHandler; } - (instancetype)init { if ((self = [super init]) == nullptr) { return nil; } _touchHandler = [RCTSurfaceTouchHandler new]; return self; } - (void)viewDidLayoutSubviews { [super viewDidLayoutSubviews]; if (!CGRectEqualToRect(_lastViewBounds, self.view.bounds)) { [_delegate boundsDidChange:self.view.bounds]; _lastViewBounds = self.view.bounds; } } - (void)loadView { self.view = [UIView new]; [_touchHandler attachToView:self.view]; } - (UIStatusBarStyle)preferredStatusBarStyle { return [RCTUIStatusBarManager() statusBarStyle]; } - (void)viewDidDisappear:(BOOL)animated { [super viewDidDisappear:animated]; _lastViewBounds = CGRectZero; } - (BOOL)prefersStatusBarHidden { return [RCTUIStatusBarManager() isStatusBarHidden]; } #if RCT_DEV && TARGET_OS_IOS - (UIInterfaceOrientationMask)supportedInterfaceOrientations { UIInterfaceOrientationMask appSupportedOrientationsMask = [RCTSharedApplication() supportedInterfaceOrientationsForWindow:RCTKeyWindow()]; if ((_supportedInterfaceOrientations & appSupportedOrientationsMask) == 0u) { RCTLogError( @"Modal was presented with 0x%x orientations mask but the application only supports 0x%x." @"Add more interface orientations to your app's Info.plist to fix this." @"NOTE: This will crash in non-dev mode.", (unsigned)_supportedInterfaceOrientations, (unsigned)appSupportedOrientationsMask); return UIInterfaceOrientationMaskAll; } return _supportedInterfaceOrientations; } #endif // RCT_DEV @end