Passing data to container view from parent view

I am using a container view (v2-container) to display data in a view controller (v2)

But I am sending data from the root view controller (v1) to this view

v1 -> v2 data transfer is done using the following code

accountContainerViewController.viewControllerID = menuItem.tag
                self.navigationController?.pushViewController(accountContainerViewController, animated: true)

      

and its performance

but to pass v2 -> v2 container i used the following code

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
    if segue.identifier == "signInSegue"{
        let controller = (segue.destinationViewController as LoginViewController)

        controller.viewControllerID = viewControllerID
    }
}

      

But this only happens the first time, but I need to transfer data every time v2 comes up with a v2 container

can someone tell me what i did wrong

early

+3


source to share





All Articles