Objective C: Load storyboard from a pod/framework

家住魔仙堡 提交于 2020-01-06 07:15:05

问题


I'm trying to load a view controller that's in a .storyboard in a pod. I'm using the following which normally works:

UIStoryboard *storyboard = [UIStoryboard 
storyboardWithName:@"StoryboardName" bundle:nil];
NewViewController *newView = [storyboard instantiateViewControllerWithIdentifier:@"NewViewController"];
[self.navigationController pushViewController:newView animated:YES];

What do I need to change it to so I can load from a pod?


回答1:


You should load it with it's bundle identifier

NSBundle* bun = [NSBundle bundleWithIdentifier:"id"]

UIStoryboard *storyboard = [UIStoryboard   storyboardWithName:@"StoryboardName" bundle:bun];



来源:https://stackoverflow.com/questions/50354684/objective-c-load-storyboard-from-a-pod-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!