CB-9762 Launch Storyboard
getImageName function is checking for : isUsingCDVLaunchScreen.
issue: it is checking for a string called 'CDVLaunchScreen'. What if i have a different storyboard name?
Fix: read "UILaunchStoryboardName" from plist. Don't* try to validate if the value is "CDVLaunchScreen".
in getImageName fucntion, if "isUsingCDVLaunchScreen" is true, you are looking for a hardcoded "imageName"
fix: read it from another flag in plist
imageName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UILaunchStoryboardImage"];
if(!imageName) //if not set in plist
imageName = @"LaunchStoryboard"; //set the default
As a fix for:
CB-9762 Launch Storyboard, all that is being done is: reading the name from xcassetts.
-->instead of fixing issue-1 & issue-2, set a flag "StoryboardImage" in plist, which is a image name.
-->read the value, get the imagename from plist vriable. if mistakenly set as path in plist, handle it
-->here u can read/check for default name in case as fallback
If you want to make the system more robust,
refer the below links.
//i am android developer, no knowledge about ios coding.
Basically, read the Storyboardname from plist, create an object from the string, then cast it to Storyboard Calss & then, try to get the id of resource(s) from storyboard.
id object = [[NSClassFromString(@"NameofClass") alloc] init];
[yourObject isKindOfClass:[a class]]
[myObject isKindOfClass:[NSString class]]
[myObject isKindOfClass:[UIImageView class]]
NSString *restorationId = self.restorationIdentifier;
MyCustomViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"MyViewController"];
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"myStoryboardName" bundle:nil];
UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"myVCID"];
[self presentViewController:vc animated:YES completion:nil];