更改TableView文本标签类型

时间:2016-01-24 18:57:11

标签: ios swift uitableview

所以在我的应用程序中,我添加了ActiveLabel,我想在我的TableView上使用它。

因此在TableView上设置文本我可以这样做:

cell.textLabel?.text = commentsArray[commentsArray.count - 1 - indexPath.row]

或者这个:

cell.textLabel?.text = commentsArray[commentsArray.count - 1 - indexPath.row] as? String

但是如何将cell.textLabel.text从UILabel更改为ActiveLabel?

1 个答案:

答案 0 :(得分:0)

您需要create custom UITableViewCell并插入ActiveLabel作为子视图。 (注意:如果您在storyboard / XIB中创建UITableViewCell,请确保为您的标签选择了正确的类。)