I am beginner doing objective C.
I was trying to understand/copy Jitsi code.
In their AppDelegate.m, they have done something like this
ViewController *rootController = (ViewController *)self.window.rootViewController;
[jitsiMeet showSplashScreen:rootController.view];
return YES;
line: https://github.com/jitsi/jitsi-meet/blob/master/ios/app/src/AppDelegate.m#L59
Here showSplashScreen is this
- (void)showSplashScreen:(UIView*)rootView {
[RNSplashScreen showSplash:@"LaunchScreen" inRootView:rootView];
}
Where RNSplashScreen showSplash method is this
+ (void)showSplash:(NSString*)splashScreen inRootView:(UIView*)rootView {
if (!loadingView) {
loadingView = [[[NSBundle mainBundle] loadNibNamed:splashScreen owner:self options:nil] objectAtIndex:0];
CGRect frame = rootView.frame;
frame.origin = CGPointMake(0, 0);
loadingView.frame = frame;
}
waiting = false;
[rootView addSubview:loadingView];
}
line: https://github.com/crazycodeboy/react-native-splash-screen/blob/master/ios/RNSplashScreen.m
Now, I did the same but they used .xib file and I was using storyboard.
Like in my info.plist I have this
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
So blindly copying the code, I did something like this in my project using storyboard but I am getting following error
someMobileMobile[73326:1790521] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/xyz/Library/Developer/CoreSimulator/Devices/1B60169F-B19B-459F-85C6-E80537C7B18B/data/Containers/Bundle/Application/5CDFA673-1009-49C3-8F7D-7F1A0C8E7F57/someMobileMobile.app> (loaded)' with name 'LaunchScreen''
Primary Question
Is this error because I am using storyboard instead of xib?
Secondary Question
Can someone please also explain the code snippet pasted above? and lastly, what does (ViewController *) mean
