Fabric/remove ios specific apis (#1533)
* Exclude MobileCoreServices/UTCoreTypes * Disable UIApplicationDidReceiveMemoryWarningNotification * Disable RCTModalHostViewComponentView Co-authored-by: Shawn Dempsey <shawndempsey@fb.com> Co-authored-by: Saad Najmi <sanajmi@microsoft.com>
This commit is contained in:
Родитель
1ae2e06db2
Коммит
d8e62165da
|
@ -13,6 +13,7 @@
|
|||
*/
|
||||
@interface RCTModalHostViewComponentView : RCTViewComponentView <RCTMountingTransactionObserving>
|
||||
|
||||
#if !TARGET_OS_OSX // [TODO(macOS GH#774)
|
||||
/**
|
||||
* Subclasses may override this method and present the modal on different view controller.
|
||||
* Default implementation presents the modal on `[self reactViewController]`.
|
||||
|
@ -28,5 +29,6 @@
|
|||
- (void)dismissViewController:(UIViewController *)modalViewController
|
||||
animated:(BOOL)animated
|
||||
completion:(void (^)(void))completion;
|
||||
#endif // ]TODO(macOS GH#774)
|
||||
|
||||
@end
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
using namespace facebook::react;
|
||||
|
||||
#if !TARGET_OS_OSX // [TODO(macOS GH#774)
|
||||
static UIInterfaceOrientationMask supportedOrientationsMask(ModalHostViewSupportedOrientationsMask mask)
|
||||
{
|
||||
UIInterfaceOrientationMask supportedOrientations = 0;
|
||||
|
@ -93,12 +94,14 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
|
|||
: ModalHostViewEventEmitter::OnOrientationChangeOrientation::Landscape;
|
||||
return {orientation};
|
||||
}
|
||||
#endif // ]TODO(macOS GH#774)
|
||||
|
||||
@interface RCTModalHostViewComponentView () <RCTFabricModalHostViewControllerDelegate>
|
||||
|
||||
@end
|
||||
|
||||
@implementation RCTModalHostViewComponentView {
|
||||
#if !TARGET_OS_OSX // [TODO(macOS GH#774)
|
||||
RCTFabricModalHostViewController *_viewController;
|
||||
ModalHostViewShadowNode::ConcreteState::Shared _state;
|
||||
BOOL _shouldAnimatePresentation;
|
||||
|
@ -107,6 +110,7 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
|
|||
RCTUIView *_modalContentsSnapshot; // TODO(macOS GH#774)
|
||||
}
|
||||
|
||||
#if !TARGET_OS_OSX // [TODO(macOS GH#774)
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
if (self = [super initWithFrame:frame]) {
|
||||
|
@ -278,6 +282,7 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
|
|||
{
|
||||
[childComponentView removeFromSuperview];
|
||||
}
|
||||
#endif // ]TODO(macOS GH#774)
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -8,7 +8,10 @@
|
|||
#import "RCTParagraphComponentView.h"
|
||||
#import "RCTParagraphComponentAccessibilityProvider.h"
|
||||
|
||||
#if !TARGET_OS_OSX // [TODO(macOS GH#774)
|
||||
#import <MobileCoreServices/UTCoreTypes.h>
|
||||
#endif // ]TODO(macOS GH#774)
|
||||
|
||||
#import <react/renderer/components/text/ParagraphComponentDescriptor.h>
|
||||
#import <react/renderer/components/text/ParagraphProps.h>
|
||||
#import <react/renderer/components/text/ParagraphState.h>
|
||||
|
|
|
@ -31,10 +31,12 @@ const NSInteger RCTComponentViewRegistryRecyclePoolMaxSize = 1024;
|
|||
if (self = [super init]) {
|
||||
_componentViewFactory = [RCTComponentViewFactory currentComponentViewFactory];
|
||||
|
||||
#if !TARGET_OS_OSX // [TODO(macOS GH#774)
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(handleApplicationDidReceiveMemoryWarningNotification)
|
||||
name:UIApplicationDidReceiveMemoryWarningNotification
|
||||
object:nil];
|
||||
#endif // ]TODO(macOS GH#774)
|
||||
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
// Calling this a bit later, when the main thread is probably idle while JavaScript thread is busy.
|
||||
|
|
Загрузка…
Ссылка в новой задаче