Programmatically get a Storyboard ID?

Jalakoo picture Jalakoo · Dec 4, 2012 · Viewed 43.7k times · Source

Trying to see if a UIViewController or UIView can identify its Storyboard ID. So was hoping for:

UIViewController *aViewController;
NSString *storyboardID = aViewController.storyboard.id;  //not an actual property

or:

NSString *storyboardID = [aViewController.storyboard valueForKey:@"storyboardId"];  //also not a working call

But no joy and couldn't find a similar solution online. Does anyone know if this is even possible?

Answer

Lolloz89 picture Lolloz89 · Apr 24, 2013

You can use the restorationIdentifier, it's right above the Storyboard identifier and it's a UIViewController property.