Programmatically Get a Storyboard Id

Programmatically get a Storyboard ID?

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

Is this possible to Set ViewController Storyboard ID programmatically?

When you programmtically create a VC , then you don't have to load it with identifier you only need

let first = FirstVC()

// in AppDelegate didFinishLaunchingWithOptions it's suppose you use

self.window?.rootViewController = UINavigationController(rootViewController: first) 

then inside the first

let second = SecondVC()
self.navigationcontroller?.pushViewController(second,animated:true)

Is it possible to programmatically get the identifier of a basic UIViewController from an UIViewController or Storyboard in Swift/Objective-C?

In Swift:

 var str: String! = self.restorationIdentifier

Get storyboard ID programmatically

Solved it with NSString *restorationId = self.restorationIdentifier;



Related Topics



Leave a reply



Submit