简体   繁体   中英

Getting reference of a tableView in a child container view in the master view controller

I have a UIViewController that has a comment UITextView in the bottom. And on the top part of the view controller i have a UIView "A content view" that has a comments UITableView being served in it.

What i need is a reference for the tableView found in the content UIView in the master UIViewController so i would be able to reload the tableView after posting a comment.

Tried several things with no luck. Always nil . Can anybody help me with a sample.

在此处输入图片说明

class MyViewController: UIViewController {

    let tableView = UITableView(frame: .zero, style: .grouped) // for example

}

Now your table view is accessible from anywhere in the view controller.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM