I tried finding some relevant questions but couldn\'t get anything, hope someone can help.
I set up some UIViewController\'s on a storyboard. I then want to load one
An (ugly) way to solve this issue:
You can set your let i
from an external buffer in your code (AppDelegate variable in this example)
required init?(coder aDecoder: NSCoder) {
self.i = UIApplication.shared().delegate.bufferForI
super.init(coder: aDecoder)
}
And when you initiate your UIViewController through Storyboard:
UIApplication.shared().delegate.bufferForI = myIValue
self.navigationController!.pushViewControllerFading(self.storyboard!.instantiateViewController(withIdentifier: "myViewControllerID") as UIViewController)
EDIT: You don't have to pass the value through the AppDelegate. Better answer here.