From de4d8f236207c01c248bb53ad0878eaa8280a850 Mon Sep 17 00:00:00 2001 From: Mithil Date: Fri, 3 Feb 2017 15:02:30 +0530 Subject: [PATCH] Fix 'HelpStackStoryboard' not found crash Environment: Xcode 8, Swift 3, Cocoapods podfile with "use_frameworks!" When using use_frameworks in podfile, the "HelpStackStoryboard" is not found since it is created using manin bundle. This results in a crash when showing help. Replacing [NSBundle mainBundle] with [NSBundle bundleForClass:self.classForCoder] resolves this issue --- Classes/Core/HSHelpStack.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/Core/HSHelpStack.m b/Classes/Core/HSHelpStack.m index ceef39c..31f9fbc 100644 --- a/Classes/Core/HSHelpStack.m +++ b/Classes/Core/HSHelpStack.m @@ -72,14 +72,14 @@ - (void)showHelp:(UIViewController*)parentController completion:(void (^)(void)) UIViewController* mainController; if([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { - UIStoryboard* helpStoryboard = [UIStoryboard storyboardWithName:@"HelpStackStoryboard-iPad" bundle:[NSBundle mainBundle]]; + UIStoryboard* helpStoryboard = [UIStoryboard storyboardWithName:@"HelpStackStoryboard-iPad" bundle:[NSBundle bundleForClass:self.classForCoder]]; mainController = [helpStoryboard instantiateInitialViewController]; [mainController setModalPresentationStyle:UIModalPresentationFormSheet]; [parentController presentViewController:mainController animated:YES completion:completion]; } else { - UIStoryboard* helpStoryboard = [UIStoryboard storyboardWithName:@"HelpStackStoryboard" bundle:[NSBundle mainBundle]]; + UIStoryboard* helpStoryboard = [UIStoryboard storyboardWithName:@"HelpStackStoryboard" bundle:[NSBundle bundleForClass:self.classForCoder]]; mainController = [helpStoryboard instantiateInitialViewController]; [parentController presentViewController:mainController animated:YES completion:completion]; }