I want to know what is the current loaded storyboard,I used the below code but it is still get me the Main storyboard not the current.
//This get me the Main storyboard
[[NSBundle mainBundle].infoDictionary objectForKey:@"UIMainStoryboardFile"];
A storyboard ID does exactly what the name implies: it identifies. Just that it identifies a view controller in a storyboard file. It is how the storyboard knows which view controller is which.
Step 1: Set a Storyboard IDIn the Storyboard, select the view controller that you want to instantiate in code. Make sure the yellow circle is highlighted, and click on the Identity Inspector. Set the custom class as well as the field called "Storyboard ID". You can use the class name as the Storyboard ID.
To get the name of a storyboard, just go to your storyboard file, and don't click on any of the View Controllers. Open up the File Inspector, and on the first tab, at the top it will have your name (ie. "Main. storyboard").
Building on Durican's answer above:
Within a view controller:
UIStoryboard * storyboard = self.storyboard;
NSString * storyboardName = [storyboard valueForKey:@"name"];
(The name will not include the ".storyboard" filename extension.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With