Instance Property

separatorInset

The default inset of cell separators.

Declaration

var separatorInset: UIEdgeInsets { get set }

Discussion

In iOS 7 and later, cell separators do not extend all the way to the edge of the table view. This property sets the default inset for all cells in the table, much as rowHeight sets the default height for cells. It is also used for managing the “extra” separators drawn at the bottom of plain style tables.

For example, to specify a table view where the default left separator inset is 3 points and the default right separator inset is 11, you would write:

tableView.separatorInset = UIEdgeInsetsMake(0, 3, 0, 11);

If every cell in a table contains an image view of the same size, by default iOS vertically aligns the leading edge of all separators. In a table that mixes text-only cells with cells that contain image views, you can use the separatorInset property to ensure that the separators are vertically aligned.

In a right-to-left user interface, an inset that you set using the separatorInset property automatically flips its left and right measurements.

Special Considerations

Only left and right insets are honored. In a right-to-left user interface, the inset measurements are automatically flipped.

See Also

Customizing the Separator Appearance

var separatorStyle: UITableViewCell.SeparatorStyle

The style for table cells used as separators.

enum UITableViewCell.SeparatorStyle

The style for cells used as separators.

var separatorColor: UIColor?

The color of separator rows in the table view.

var separatorEffect: UIVisualEffect?

The effect applied to table separators.

var separatorInsetReference: UITableView.SeparatorInsetReference

An indicator of how the separator inset value should be interpreted.

enum UITableView.SeparatorInsetReference

Constants indicating how to interpret the separator inset value of a table view.