【问题标题】:How to have UIView update as a button in a tableviewcell is clicked如何将 UIView 更新为 tableviewcell 中的按钮被单击
【发布时间】:2019-12-09 13:18:13
【问题描述】:

我有一个独立于我的 UIViewController 文件定义的 tableviewcell 类。在我的 UIViewController 中,我有一个 UIView,它是应用程序背景的一部分。我在 tableviewcell 中有一个按钮(所以在它的类中),我希望在单击 tableviewcell 的按钮时改变背景。如何刷新 UIView?

【问题讨论】:

    标签: ios swift button uiview


    【解决方案1】:

    当您单击 tableviewcell 时,您应该使用委托或闭包来处理回调。 请点击以下链接:

    Delegation in swift

    Closures in swift

    【讨论】:

      猜你喜欢
      • 2018-07-02
      • 1970-01-01
      • 2014-10-04
      • 2020-05-02
      • 2011-03-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多