【问题标题】:How can I write [UITableViewCell class] in swift?如何快速编写 [UITableViewCell 类]?
【发布时间】:2015-07-07 09:20:22
【问题描述】:

在 Objective-c 中,我们可以这样为UITableView 注册类:

[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cellIdentifier"];

但我不能在 Swift 中编写 UITableViewCell 类。那么如何在swift中写[UITableViewCell class]呢?

【问题讨论】:

标签: ios swift tableview tableviewcell


【解决方案1】:

您可以这样做来注册您的课程:

self.tableView.registerClass(UITableViewCell.self, forCellReuseIdentifier: "cellIdentifier")

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-12-09
    • 2016-05-06
    • 2012-10-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-14
    • 1970-01-01
    相关资源
    最近更新 更多