I created a bundle file and imported the bundle file into my project. There is a storyboard in this bundle file and I would like to create view from this storyboard. I have been trying to find out correct way to do this for 2 days, but got no luck. It always shows "'Could not find a storyboard named 'StoryboardA' in bundle NSBundle" error. I have a sample project here : https://github.com/tsunglintsai/Storyboard-In-Resource-Bundle.
Following is code I tried.
NSBundle *resourceBundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"bundlefilename" ofType:@"bundle"]];
[resourceBundle load];
NSLog(@"resourceBundle:%@",resourceBundle);
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"StoryboardA" bundle:resourceBundle];
UIViewController *vc = [sb instantiateViewControllerWithIdentifier:@"myViewController"];
vc.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentViewController:vc animated:YES completion:NULL];
-- I can't find answer from following similar question posts:
How to load storyboard file from custom bundle in IOS app?
Xcode Copy Bundle Resources can't find files
"Could not find a storyboard named 'MainStoryboard' in bundle NSBundle"