swift - UItableViewCell 中的 Present 函数是否有替代方案?

标签 swift uitableview uiviewcontroller navigation xib

<分区>

我想从 UITableViewCell(Xib) 导航到 UIViewController 但是当我尝试使用 present Value of type 'TableViewCell' has no member 'present 因此,如果有人熟悉可以帮助我导航的功能,请帮助我 :)。

谢谢你的时间

最佳答案

UITableViewCell 无法显示 View Controller 。请将 viewController 存储到 tableview 单元格中的变量中。并用它来呈现。 或者使用 didSelectRowAt 委托(delegate)函数并使用 self 来呈现(或者如果您的事件通过单元格中的按钮触发,则编写您的自定义单元格委托(delegate))

关于swift - UItableViewCell 中的 Present 函数是否有替代方案?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57726573/

相关文章:

swift - 对 Contains 和 Dictionary/[String :String] 的类型问题感到困惑

ios - 解雇ModalViewControllerAnimated时显示正确的UIView :completion: is called

ios - 导航到新的 UINavigationController

swift - SWReveal TableViewController - 如何启动到不同的 ViewControllers?

ios - Material 组件选项卡栏 Controller 错误

ios - 选择节标题时显示行

ios - 如何从didSelectRowAtIndexPath初始化自定义UITableViewCell

ios - tableview 不刷新已删除的数据

ios - 使用界面构建器将多个页面添加到 ScrollView

ios - 如果我的 View Controller 不可滚动,我可以执行 'pull to refresh' 操作吗?