Jason K. Jason K. - 5 months ago 44
Objective-C Question

Programmatically get a Storyboard ID?

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

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


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?


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