移除 UItableView Cell 的首行分隔符

Remove first line separator of UItableView Cell

如何以编程方式隐藏或删除 tableViewCell 的第一行分隔符?

我只需要删除单元格 0 的顶行。

这种性质的东西:

if(indexPath.row == 0){
   //remove top seperator
}

在您的 cellForRowAt 委托函数中,您可以使用:

if indexPath.row == 0 {
        cell?.separatorInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: .greatestFiniteMagnitude)
    }