Aucune description

ViewController.m 688B

1234567891011121314151617181920212223
  1. #import "ViewController.h"
  2. #import "AppDelegate.h"
  3. #import <React/RCTRootView.h>
  4. @implementation ViewController
  5. - (void)viewDidLoad {
  6. [super viewDidLoad];
  7. RCTBridge *bridge = [((AppDelegate *)[NSApp delegate])bridge];
  8. RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"example" initialProperties:nil];
  9. NSView *view = [self view];
  10. [view addSubview:rootView];
  11. [rootView setBackgroundColor:[NSColor windowBackgroundColor]];
  12. [rootView setFrame:[view bounds]];
  13. [rootView setAutoresizingMask:(NSViewMinXMargin | NSViewMinXMargin | NSViewMinYMargin | NSViewMaxYMargin | NSViewWidthSizable | NSViewHeightSizable)];
  14. }
  15. @end