0

我是Swiftand的初学者Xcode,我想知道IBDesignable在 a 中使用该类的做法是什么UITableView。我在课堂上设计了卡片,以便直接在我的故事板中查看结果,但我有一些标签、UIImage 和其他组件需要UITableView在此函数中动态修改:

public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! CardCell

    let cardData: Card
    cardData = self.card[indexPath.row]

    // Here I want to catch the card what I design in the class IBDesignableCard to set the IBDesignableCard.label, IBDesignableCard.userImage ...

    return cell // And here return the IBDesignableCard
    }

我怎样才能做到这一点?谢谢你的回复。

4

0 回答 0