Search code examples
iosuistoryboardxcode-storyboard

Set separatorStyle for a table view, but on Storyboard


In code you can

tableview.separatorStyle = UITableViewCellSeparatorStyle.None

However, (1) on Storyboard I experimented with using User Defined Runtime Attributes. In fact, this

enter image description here

works well to get rid of the separators. But it would be better to somehow use the constant, UITableViewCellSeparatorStyle.None rather than guess a zero. Is there a way?

Also (2) Is it in fact correct that on the Attributes Inspector, for UITableView, there is no way to turn off separators?

(As a further curiosity, for me the Separator Inset control simply does not work, it changes nothing on the separators.)


Solution

  • You could alway set separator from storyboard as well as from xibs. Here's how you can do it.

    separator enter image description here