1

I have created my own framework which has storyboard. I have imported the framework in my project but when I tried to access the storyboard from framework with below code I am getting error

"Exception: Could not find a storyboard named 'AssignTasks' in bundle NSBundle".

can we have UI in framework? can anyone help me here?

NSBundle *bundleName = [NSBundle bundleWithIdentifier:@"bundle id of framework"];
UIStoryboard *stainStoryboard = [UIStoryboard storyboardWithName:@"AssignTasks" bundle: bundleName];
self.assignTasksListView = (AssignTasksListView*)[stainStoryboard instantiateViewControllerWithIdentifier: @"AssignTasksListView"];
rmaddy
  • 314,917
  • 42
  • 532
  • 579
amar
  • 175
  • 3
  • 19
  • Possible duplicate of [Path to bundle of iOS framework](https://stackoverflow.com/questions/44086009/path-to-bundle-of-ios-framework) – Shamas S Mar 06 '19 at 09:25

1 Answers1

1

What you need to do is make sure you're using the correct bundle and that your storyboard file is copied to the bundle.

Select the Storyboard file and on the right, in File Inspector, make sure you've selected Target Membership and used your Framework. Or, alternatively, go to your project settings, to Build Phases > Copy Bundle resources and make sure the storyboard file is there.

The bundle identifier can be found Project Settings > Build Settings > Product Bundle Identifier.

Or, alternatively, you can programmatically grab the correct bundle, provided the storyboard is in the same bundle as one of your Framework classes

NSBundle *bundle = [NSBundle bundleForClass:[OneOfYourFrameworkClasses class]];
mag_zbc
  • 6,801
  • 14
  • 40
  • 62
  • Did this NSBundle *bundle = [NSBundle bundleForClass:[OneOfYourFrameworkClasses class]]; but getting error :- ld: symbol(s) not found for architecture x86_64 – amar Mar 06 '19 at 13:11