There is a viewController in it container viewController how to transfer a variable to a container that immediately parses the data from the user User default does not work Variable to be in the container
Closed due to the fact that the essence of the question is incomprehensible by the participants Max Mikheyenko , post_zeew , VAndrJ , aleksandr barakin , cheops Oct 31 '16 at 4:44 .
Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .
|
1 answer
In IB, specify the id for your segue, then you need the override func prepare(for segue: UIStoryboardSegue, sender: Any?) method override func prepare(for segue: UIStoryboardSegue, sender: Any?) .
Sample code:
override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "YourSegueId" { if let destinationVC = segue.destinationViewController as? YourViewController { destinationVC.yourProperty = "Some value" } } } Addition:
Segue triggers when loading a container. More here
|