Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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]`.
Expand All @@ -28,5 +29,6 @@
- (void)dismissViewController:(UIViewController *)modalViewController
animated:(BOOL)animated
completion:(void (^)(void))completion;
#endif // ]TODO(macOS GH#774)

@end
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

using namespace facebook::react;

#if !TARGET_OS_OSX // [TODO(macOS GH#774)
static UIInterfaceOrientationMask supportedOrientationsMask(ModalHostViewSupportedOrientationsMask mask)
{
UIInterfaceOrientationMask supportedOrientations = 0;
Expand Down Expand Up @@ -93,12 +94,14 @@ static UIModalPresentationStyle presentationConfiguration(ModalHostViewProps con
: 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;
Expand All @@ -107,6 +110,7 @@ @implementation RCTModalHostViewComponentView {
RCTUIView *_modalContentsSnapshot; // TODO(macOS GH#774)
}

#if !TARGET_OS_OSX // [TODO(macOS GH#774)
- (instancetype)initWithFrame:(CGRect)frame
{
if (self = [super initWithFrame:frame]) {
Expand Down Expand Up @@ -278,6 +282,7 @@ - (void)unmountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childCo
{
[childComponentView removeFromSuperview];
}
#endif // ]TODO(macOS GH#774)

@end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 2 additions & 0 deletions React/Fabric/Mounting/RCTComponentViewRegistry.mm
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ - (instancetype)init
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.
Expand Down