PHP 7.4.33
Preview: RCTWrapper.h Size: 4.53 KB
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/react-native/Libraries/Wrapper/RCTWrapper.h
/*
 * 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 <UIKit/UIKit.h>

#import <RCTWrapper/RCTWrapperView.h>
#import <RCTWrapper/RCTWrapperViewControllerHostingView.h>
#import <RCTWrapper/RCTWrapperViewManager.h>

// Umbrella header with macros

// RCT_WRAPPER_FOR_VIEW
#define RCT_WRAPPER_FOR_VIEW(ClassName)         \
                                                \
  NS_ASSUME_NONNULL_BEGIN                       \
                                                \
  @interface ClassName                          \
  ##Manager : RCTWrapperViewManager             \
                                                \
              @end                              \
                                                \
  NS_ASSUME_NONNULL_END                         \
                                                \
  @implementation ClassName                     \
  ##Manager                                     \
                                                \
      RCT_EXPORT_MODULE()                       \
                                                \
      - (UIView *)view                          \
  {                                             \
    RCTWrapperView *wrapperView = [super view]; \
    wrapperView.contentView = [ClassName new];  \
    return wrapperView;                         \
  }                                             \
                                                \
  @end

// RCT_WRAPPER_FOR_VIEW_CONTROLLER
#define RCT_WRAPPER_FOR_VIEW_CONTROLLER(ClassName)                                                                     \
                                                                                                                       \
  NS_ASSUME_NONNULL_BEGIN                                                                                              \
                                                                                                                       \
  @interface ClassName                                                                                                 \
  ##Manager : RCTWrapperViewManager                                                                                    \
                                                                                                                       \
              @end                                                                                                     \
                                                                                                                       \
  NS_ASSUME_NONNULL_END                                                                                                \
                                                                                                                       \
  @implementation ClassName                                                                                            \
  ##Manager                                                                                                            \
                                                                                                                       \
      RCT_EXPORT_MODULE()                                                                                              \
                                                                                                                       \
      - (UIView *)view                                                                                                 \
  {                                                                                                                    \
    RCTWrapperViewControllerHostingView *contentViewControllerHostingView = [RCTWrapperViewControllerHostingView new]; \
    contentViewControllerHostingView.contentViewController = [[ClassName alloc] initWithNibName:nil bundle:nil];       \
    RCTWrapperView *wrapperView = [super view];                                                                        \
    wrapperView.contentView = contentViewControllerHostingView;                                                        \
    return wrapperView;                                                                                                \
  }                                                                                                                    \
                                                                                                                       \
  @end

Directory Contents

Dirs: 1 × Files: 9
Name Size Perms Modified Actions
Example DIR
- drwxr-xr-x 2025-03-28 11:04:43
Edit Download
4.53 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
449 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
3.30 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
1.09 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
2.07 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
748 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
3.41 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
398 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
539 B lrw-r--r-- 2025-03-28 11:04:43
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).