lundi 23 février 2015

Programmatically invoked Storyboard-ViewController missing images

I have designed a view with a couple of images. When I check "Is Initial View Controller" in Interface Builder, it displays fine, including the images. If I invoke it through code, the images are missing. My images are defined in the Images.xcassets-file. It does not make a difference if I place this file in the root-project-directory or in a subfolder.


That's how I invoke the view :



// Tried different bundles here, e.g. NSBundle.mainBundle() or nil :
var storyboard = UIStoryboard(name: "Main", bundle: parentView.nibBundle)
var loginView : LoginViewController = storyboard.instantiateViewControllerWithIdentifier("LoginViewController") as LoginViewController!

// Tried different PresentationStyle here, e.g. "FullScreen" :
loginView.modalPresentationStyle = UIModalPresentationStyle.Popover
parentView.presentViewController(loginView, animated: true, completion: nil)

Aucun commentaire:

Enregistrer un commentaire