Eloy Durán 2d9b0803e0
feat(macOS): Make podspec compatible with macOS (#1328)
* [apple] Move iOS/macOS src into common apple dir

* [apple] Enable macOS as platform in podspec

* [example] Use CocoaPods & auto-linking on macOS

* [docs] Update setup for macOS

* [package] Include apple dir in distribution
2020-04-24 19:54:17 +02:00

23 lines
688 B
Objective-C

#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