I am creating instance of ViewControllerB from ViewControllerA using instantiateViewControllerWithIdentifier(identifier: String)
function.
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateViewControllerWithIdentifier("vcB") as VCB;
rootController!.presentViewController(vc, animated: true, completion: nil)
class VCB: UIViewController {
required init?(coder aDecoder: NSCoder){
super.init(coder: aDecoder)
}
}
I want to access value which i have passed in my ViewControllerB how can i achieve this.
i alredy gone through Passing Data between View Controllers link but the answers in objective c.
You just can declare a
var
in yourVCB
viewController and inject data to this propertyJust use this code send data from one view controller to anotherview controller
You may try
And the other class