PHP 7.4.33
Preview: RCTLogBoxView.mm Size: 2.39 KB
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/react-native/React/CoreModules/RCTLogBoxView.mm
/*
 * 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 "RCTLogBoxView.h"

#import <React/RCTLog.h>
#import <React/RCTSurface.h>
#import <React/RCTSurfaceHostingView.h>

@implementation RCTLogBoxView {
  RCTSurface *_surface;
}

- (instancetype)initWithFrame:(CGRect)frame
{
  if ((self = [super initWithFrame:frame])) {
    self.windowLevel = UIWindowLevelStatusBar - 1;
    self.backgroundColor = [UIColor clearColor];
  }
  return self;
}

- (void)createRootViewController:(UIView *)view
{
  UIViewController *_rootViewController = [UIViewController new];
  _rootViewController.view = view;
  _rootViewController.view.backgroundColor = [UIColor clearColor];
  _rootViewController.modalPresentationStyle = UIModalPresentationFullScreen;
  self.rootViewController = _rootViewController;
}

- (instancetype)initWithWindow:(UIWindow *)window bridge:(RCTBridge *)bridge
{
  RCTErrorNewArchitectureValidation(RCTNotAllowedInFabricWithoutLegacy, @"RCTLogBoxView", nil);

  self = [super initWithWindowScene:window.windowScene];

  self.windowLevel = UIWindowLevelStatusBar - 1;
  self.backgroundColor = [UIColor clearColor];

  _surface = [[RCTSurface alloc] initWithBridge:bridge moduleName:@"LogBox" initialProperties:@{}];
  [_surface start];

  if (![_surface synchronouslyWaitForStage:RCTSurfaceStageSurfaceDidInitialMounting timeout:1]) {
    RCTLogInfo(@"Failed to mount LogBox within 1s");
  }
  [self createRootViewController:(UIView *)_surface.view];

  return self;
}

- (instancetype)initWithWindow:(UIWindow *)window surfacePresenter:(id<RCTSurfacePresenterStub>)surfacePresenter
{
  self = [super initWithWindowScene:window.windowScene];

  id<RCTSurfaceProtocol> surface = [surfacePresenter createFabricSurfaceForModuleName:@"LogBox" initialProperties:@{}];
  [surface start];
  RCTSurfaceHostingView *rootView = [[RCTSurfaceHostingView alloc]
      initWithSurface:surface
      sizeMeasureMode:RCTSurfaceSizeMeasureModeWidthExact | RCTSurfaceSizeMeasureModeHeightExact];
  [self createRootViewController:rootView];

  return self;
}

- (void)layoutSubviews
{
  [super layoutSubviews];
  [_surface setSize:self.frame.size];
}

- (void)dealloc
{
  [RCTSharedApplication().delegate.window makeKeyWindow];
}

- (void)show
{
  [self becomeFirstResponder];
  [self makeKeyAndVisible];
}

@end

Directory Contents

Dirs: 1 × Files: 57
Name Size Perms Modified Actions
- drwxr-xr-x 2025-03-28 11:04:43
Edit Download
2.08 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
1.79 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
563 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
1.40 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
17.27 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
313 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
11.61 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
354 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
1.34 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
560 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
7.79 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
747 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
4.75 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
273 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
3.97 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
285 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
1.10 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
305 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
10.95 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
360 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
9.44 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
2.81 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
19.67 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
3.39 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
18.50 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
287 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
1.66 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
557 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
7.44 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
1.87 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
6.37 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
618 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
3.05 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
418 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
1.31 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
281 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
4.42 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
355 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
3.02 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
665 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
2.39 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
15.07 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
319 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
2.71 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
2.16 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
27.56 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
321 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
988 B lrw-r--r-- 2025-03-28 11:04:43
Edit Download
481 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
6.00 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
1.03 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
12.10 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
448 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
9.24 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
1.07 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
6.25 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
3.01 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).