mirror of
https://github.com/status-im/react-native-webview.git
synced 2026-08-31 19:51:10 +00:00
30 lines
856 B
Objective-C
30 lines
856 B
Objective-C
/**
|
|
* 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 "ViewController.h"
|
|
#import "AppDelegate.h"
|
|
|
|
#import <React/RCTRootView.h>
|
|
|
|
@implementation ViewController
|
|
|
|
- (void)viewDidLoad {
|
|
[super viewDidLoad];
|
|
|
|
RCTBridge *bridge = [((AppDelegate *)[NSApp delegate])bridge];
|
|
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"example" initialProperties:nil];
|
|
|
|
NSView *view = [self view];
|
|
|
|
[view addSubview:rootView];
|
|
[rootView setBackgroundColor:[NSColor windowBackgroundColor]];
|
|
[rootView setFrame:[view bounds]];
|
|
[rootView setAutoresizingMask:(NSViewMinXMargin | NSViewMinXMargin | NSViewMinYMargin | NSViewMaxYMargin | NSViewWidthSizable | NSViewHeightSizable)];
|
|
}
|
|
|
|
@end
|