Insert UITableViewController into Other UIView

后端 未结 1 539
耶瑟儿~
耶瑟儿~ 2021-02-06 17:08

I\'ve got a UITableViewController that inserts custom UITableViewCells into a UITableView. Is there a way that I can put this UITableController/View combo into different views?

1条回答
  •  南旧
    南旧 (楼主)
    2021-02-06 17:43

    Yes, you can, simply instantiate (or get a reference to) the UITableViewController inside the UIViewController and call something like this:

    [self.view addSubview:tableViewController.tableView];
    

    0 讨论(0)
提交回复
热议问题