with the transition on iOS7 the separator has 15px padding on left. I know that i can remove this padding with separator inset feature on the UITableView setting in the xib file, but i need to keep heading text with padding. How to do it?
default:
with custom on separator inset to 0:
i need to keep separators like figure 2, but the header with "2013" like picture 1.
USING SWIFT AND STORYBOARD
In storyboard you can set different separator insets for the TableView (header) and for Cells (separators).
Set the separator inset for cell to 0, by selecting the cell in Storyboard and setting the following:
Then set the separator inset for the TableView (for the header) to 15, by selecting the TableView in Storyboard and setting the following:
OPTIONAL:
You may also need to set the margins on the cells to be zero programmatically to ensure that the separator goes all the way from left to right. Use this code if needed in your table view controller's swift file:
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell: UITableViewCell = tableView.dequeueReusableCellWithIdentifier("YOURCELL", forIndexPath: indexPath) as! UITableViewCell
// THIS IS THE IMPORTANT PART...
cell.layoutMargins = UIEdgeInsetsZero
cell.preservesSuperviewLayoutMargins = false
return cell
}