I'm developing a React Native application and I would like to use a UISplitViewController interface. This would allow the correct format for iPad and iPhone as well as split view and multitasking.
I haven't been able to find any information on how to setup a UISplitViewController controller in React Native. I wonder if anyone could help me with advice on how I can setup a UISplitViewController using React Native for iOS. I am a iOS developer by background in swift so it would be amazing to learn how to do this in React Native.
Also I wonder if you could provide me some help on how to then do the same layout (UISplitViewController) type on the Android side for the Raect Native App.
Thank you for your help on this one.
There is no included bridge to Split View Controller in React Native. However, you can write your own Native Module (see https://facebook.github.io/react-native/docs/native-modules-ios.html) — once you set it up it’s typically just a few lines of code for each method call you want to enable. You may wish to review the source code for https://github.com/wix/react-native-navigation in order to see how they implement some of the same functions on a UINavigationController.
Android doesn’t have an equivalent to iOS/tvOS’s split view controller, so you’ll either need to roll your own on the Java side of things, or just bridge to regular Activity/Fragments in Android.
This bridge is probably fine for a split view controller. But if you really want good tablet support for your app, including split screen multitasking, drag and drop, PIP video, stylus support, etc., you should probably just write it fully native instead of using React Native since the tablet support isn’t really there.