Rafael Enterplay Rafael Enterplay - 2 years ago 128
Swift Question

SWIFT - Storyboard instantiating from Objective-C

I'm translating an old app made in Objective-C to the new SWIFT 2.0 language, but I'm having some hard time in this particular line of code:

UIStoryboard *sdkStoryboard = [UIStoryboard storyboardWithName:@"MyStoryboard" bundle:[NSBundle bundleWithIdentifier:@"thirdParty.MySDK"]];

The problem lies in the "bundle" part, I made many researches but none of them could do the trick, as most of the examples found were to "bundle: nil"

This is what I could do by now:

let sdkStoryboard: UIStoryboard = UIStoryboard(name: "MyStoryboard", bundle: ???)


Answer Source

How about:

UIStoryboard(name: "MyStoryboard", bundle: NSBundle(identifier: "thirdParty.MySDK"))
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download