如何在TableView中使用TableViewController类?

时间:2015-12-25 12:33:58

标签: ios swift uitableview

在我的应用程序中,我想在UIViewController中显示TWTRTimelineViewController(TableViewController)。但TWTRTimelineViewController的代码只能在 UITableViewController类中使用,而不能在UITableView Classe中使用。有没有办法解决这个问题,例如显示 UIViewController 中的y-postition上的UITableViewController? 谢谢!

2 个答案:

答案 0 :(得分:1)

您应该使用故事板创建UIViewController而不是包含tableView,并将其与UIViewController@IBOutlet)连接。接下来,您将为tableView原型单元格设置标识符。在你的UIViewController中,你将扩展代理UITableViewDelegateUITableViewDataSource并实现协议。

This tutorial非常详细,会为您提供实现预期目标的所有步骤。

答案 1 :(得分:1)

你不能在UITableView中设置UITableViewController自定义类,如果你使用的第三方类是UITableViewController,那么你必须在故事板的UITableViewController中使用它