Filling the built-in UITableViewController

I have an application using a navigation controller. In one of the views, I have a view container with a built-in UITableViewController using static cells. I need to populate these table controller labels with the data passed from the previous view. The stream is as follows

View1> segue-> Parent> Child

I need to pass data from View1 to Child. When testing this, it appears that ChildviewDidLoad starts before the parent view of DidLoad. This does not seem logical to me. Using viewDidAppear in Child works, but there is latency in updating labels, which is actually unacceptable.

Can someone shed some light on how to update the built-in UITableViewController when its parent is loaded?

Thank!

+3
source share
1 answer

Pass the data to the parent element in prepareForSegue, and in the viewDidLoad (of the parent) pass the string to the child element. In the child, set the value of its label in this line to viewWillAppear :.

+1
source

Source: https://habr.com/ru/post/1537198/


All Articles