Jason K. Jason K. - 1 year ago 110
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?

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download