app*_*uru 5 uitableview ios uicontainerview
我有一个自定义 UIViewController“ProfileController”,带有 2 个子子视图 - 最重要的是嵌入 UITableViewController 的容器子子视图。如何从“ProfileController”中访问 UITableViewController,以便我可以动态配置用于显示用户配置文件信息的“静态”单元格。
我不想使用独立的 UITableViewController,因为这样我就无法为个人资料屏幕的 UI 添加额外的自定义项。谢谢!
...不幸的是,我无法在情节提要中为标准 UITableView 设计静态单元格,因为我发现 Apple 的静态单元格实现与 UITableViewController 紧密耦合。确实很糟糕。
在你的ProfileController覆盖中:
override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!){
if segue.identifier == "whateverYouNamedTheEmbedSegue"{
myTableViewController = segue.destinationViewController as UITableViewController
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2029 次 |
| 最近记录: |