yeet
This commit is contained in:
16
node_modules/react-native/Libraries/Wrapper/Example/RCTWrapperExampleView.h
generated
vendored
Normal file
16
node_modules/react-native/Libraries/Wrapper/Example/RCTWrapperExampleView.h
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Copyright (c) Facebook, Inc. and its 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>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCTWrapperExampleView : UIView
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
60
node_modules/react-native/Libraries/Wrapper/Example/RCTWrapperExampleView.m
generated
vendored
Normal file
60
node_modules/react-native/Libraries/Wrapper/Example/RCTWrapperExampleView.m
generated
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#import "RCTWrapperExampleView.h"
|
||||
|
||||
#import <RCTWrapper/RCTWrapper.h>
|
||||
|
||||
@implementation RCTWrapperExampleView {
|
||||
NSTimer *_timer;
|
||||
CGSize _intrinsicContentSize;
|
||||
}
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
if (self = [super initWithFrame:frame]) {
|
||||
self.backgroundColor = [UIColor whiteColor];
|
||||
|
||||
_intrinsicContentSize = CGSizeMake(64, 64);
|
||||
_timer = [NSTimer scheduledTimerWithTimeInterval:1.0
|
||||
target:self
|
||||
selector:@selector(tick)
|
||||
userInfo:nil
|
||||
repeats:YES];
|
||||
|
||||
UITapGestureRecognizer *gestureRecognizer =
|
||||
[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tick)];
|
||||
[self addGestureRecognizer:gestureRecognizer];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)tick
|
||||
{
|
||||
_intrinsicContentSize.width = 32 + arc4random() % 128;
|
||||
_intrinsicContentSize.height = 32 + arc4random() % 128;
|
||||
|
||||
[self invalidateIntrinsicContentSize];
|
||||
[self.superview setNeedsLayout];
|
||||
}
|
||||
|
||||
- (CGSize)intrinsicContentSize
|
||||
{
|
||||
return _intrinsicContentSize;
|
||||
}
|
||||
|
||||
- (CGSize)sizeThatFits:(CGSize)size
|
||||
{
|
||||
return CGSizeMake(
|
||||
MIN(size.width, _intrinsicContentSize.width),
|
||||
MIN(size.height, _intrinsicContentSize.height)
|
||||
);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
RCT_WRAPPER_FOR_VIEW(RCTWrapperExampleView)
|
16
node_modules/react-native/Libraries/Wrapper/Example/RCTWrapperExampleViewController.h
generated
vendored
Normal file
16
node_modules/react-native/Libraries/Wrapper/Example/RCTWrapperExampleViewController.h
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Copyright (c) Facebook, Inc. and its 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>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCTWrapperExampleViewController : UIViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
22
node_modules/react-native/Libraries/Wrapper/Example/RCTWrapperExampleViewController.m
generated
vendored
Normal file
22
node_modules/react-native/Libraries/Wrapper/Example/RCTWrapperExampleViewController.m
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#import "RCTWrapperExampleViewController.h"
|
||||
|
||||
#import <RCTWrapper/RCTWrapper.h>
|
||||
|
||||
#import "RCTWrapperExampleView.h"
|
||||
|
||||
@implementation RCTWrapperExampleViewController
|
||||
|
||||
- (void)loadView {
|
||||
self.view = [RCTWrapperExampleView new];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
RCT_WRAPPER_FOR_VIEW_CONTROLLER(RCTWrapperExampleViewController)
|
20
node_modules/react-native/Libraries/Wrapper/Example/RCTWrapperReactRootViewController.h
generated
vendored
Normal file
20
node_modules/react-native/Libraries/Wrapper/Example/RCTWrapperReactRootViewController.h
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright (c) Facebook, Inc. and its 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>
|
||||
|
||||
@class RCTBridge;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCTWrapperReactRootViewController : UIViewController
|
||||
|
||||
- (instancetype)initWithBridge:(RCTBridge *)bridge;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
47
node_modules/react-native/Libraries/Wrapper/Example/RCTWrapperReactRootViewController.m
generated
vendored
Normal file
47
node_modules/react-native/Libraries/Wrapper/Example/RCTWrapperReactRootViewController.m
generated
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#import "RCTWrapperReactRootViewController.h"
|
||||
|
||||
#import <RCTWrapper/RCTWrapper.h>
|
||||
#import <React/RCTBridge.h>
|
||||
#import <React/RCTRootView.h>
|
||||
|
||||
#import "RCTWrapperExampleView.h"
|
||||
|
||||
@implementation RCTWrapperReactRootViewController {
|
||||
RCTBridge *_bridge;
|
||||
}
|
||||
|
||||
- (instancetype)initWithBridge:(RCTBridge *)bridge
|
||||
{
|
||||
if (self = [super initWithNibName:nil bundle:nil]) {
|
||||
_bridge = bridge;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)loadView
|
||||
{
|
||||
RCTRootView *rootView =
|
||||
[[RCTRootView alloc] initWithBridge:_bridge
|
||||
moduleName:@"WrapperExample"
|
||||
initialProperties:@{}];
|
||||
|
||||
rootView.backgroundColor = [UIColor whiteColor];
|
||||
|
||||
UIActivityIndicatorView *progressIndicatorView =
|
||||
[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
|
||||
[progressIndicatorView startAnimating];
|
||||
rootView.loadingView = progressIndicatorView;
|
||||
|
||||
rootView.sizeFlexibility = RCTRootViewSizeFlexibilityWidthAndHeight;
|
||||
self.view = rootView;
|
||||
}
|
||||
|
||||
@end
|
18
node_modules/react-native/Libraries/Wrapper/Example/RCTWrapperReactRootViewManager.h
generated
vendored
Normal file
18
node_modules/react-native/Libraries/Wrapper/Example/RCTWrapperReactRootViewManager.h
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) Facebook, Inc. and its 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/RCTWrapperViewManager.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCTWrapperReactRootViewManager : RCTWrapperViewManager
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
32
node_modules/react-native/Libraries/Wrapper/Example/RCTWrapperReactRootViewManager.m
generated
vendored
Normal file
32
node_modules/react-native/Libraries/Wrapper/Example/RCTWrapperReactRootViewManager.m
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#import "RCTWrapperReactRootViewManager.h"
|
||||
|
||||
#import <RCTWrapper/RCTWrapperView.h>
|
||||
#import <RCTWrapper/RCTWrapperViewControllerHostingView.h>
|
||||
|
||||
#import "RCTWrapperReactRootViewController.h"
|
||||
|
||||
@implementation RCTWrapperReactRootViewManager
|
||||
|
||||
RCT_EXPORT_MODULE()
|
||||
|
||||
- (UIView *)view
|
||||
{
|
||||
RCTWrapperViewControllerHostingView *contentViewControllerHostingView =
|
||||
[RCTWrapperViewControllerHostingView new];
|
||||
|
||||
contentViewControllerHostingView.contentViewController =
|
||||
[[RCTWrapperReactRootViewController alloc] initWithBridge:self.bridge];
|
||||
|
||||
RCTWrapperView *wrapperView = [super view];
|
||||
wrapperView.contentView = contentViewControllerHostingView;
|
||||
return wrapperView;
|
||||
}
|
||||
|
||||
@end
|
Reference in New Issue
Block a user