To achieve this, you can switch the UIViewController
currently being used to one that implements
preferredScreenEdgesDeferringSystemGestures
according to your preferences.
Firstly, start by creating a new class called MainViewController
, which will return the desired value:
//
// MainViewController.h
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface MainViewController : UIViewController
@end
NS_ASSUME_NONNULL_END
Then in MainViewController.m:
//
// MainViewController.m
//
#import "MainViewController.h"
@interface MainViewController ()
@end
@implementation MainViewController
- (UIRectEdge)preferredScreenEdgesDeferringSystemGestures
{
return UIRectEdgeBottom;
}
@end
Lastly, replace the generic view controller with the specialized one we just created:
#import "AppDelegate.h"
+#import "MainViewController.h"
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
===== SNIP =====
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0 green:1.0 blue:1.0 alpha:1.0];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
- UIViewController *rootViewController = [UIViewController new];
+ UIViewController *rootViewController = [MainViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];