whitney13625 whitney13625 -4 years ago 167
Swift Question

How to remove the separator for only one section in a static UITableView?

I'm implementing a static TableView which has two sections in Swift. I want to have the same effect as

UITableViewCellSeparatorStyle.None
in only section 0, while remaining the separator in the other section. Since it is a static TableView, I cannot configure the cell in
cellForRowAtIndexPath
function (which always get a cell value
nil
). I tried to make some IBOutlet for each of the static cells and configure their
seperatorInset
and
layoutMargins
property, however it just doesn't work. So I would like to know if there are other ways to remove the separators? Thanks!

Answer Source

There is no direct way to set it up using tableview Separator. As you said its a static tableview, so simple way to do it is just Remove the Separator from the tableview and add the Separator UIComponent at the bottom which looks like a Separator for the required cells.

Here is the screenshot for that as wellenter image description here

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download