I am trying to add an ad unit above a subclass of UIView RCTRootView
. This would move the RCTRootView
down about 50px. This is my current attempt.
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"test"
launchOptions:launchOptions];
CGRect frame = rootView.frame;
frame.size.height -= 50;
rootView.frame = frame;
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
self.window.autoresizesSubviews = YES;
UIViewController *rootViewController = [[UIViewController alloc] init];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
return YES;
This is a React Native project, so use of a StoryBoard. How can I resize the rootView?
How can I instantiate and append a viewController within UIWindow that is above the rootView (Ad unit)?