How to access tableviewcontroller built into container view

I have a custom UIViewController "ProfileController" with 2 child children - the most important of which is the child view of the container into which the UITableViewController is embedded. How to access the UITableViewController from the "ProfileController" so that I can dynamically configure the "static" cells that I use to display user profile information.

I did not want to use the standalone UITableViewController, since I cannot add additional settings to the user interface for the profile screen. Thank!

... I'm sorry that I can’t create static cells for the standard UITableView in the storyboard, as I found out that the implementation of the apples of the static cells is closely related to the UITableViewController. Bummer, really.

+4
source share
1 answer

In your ProfileControllerredefinition:

override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!){
    if segue.identifier == "whateverYouNamedTheEmbedSegue"{
        myTableViewController = segue.destinationViewController as UITableViewController
    }
}
+1
source

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


All Articles