I'm incurred in a little problem customizing my cell;
as you can see the separator line do not reach the left border of the cell, and a I'd like to do it. I found these:
Can anyone help me to translate in swift code?
For conversion of the answer (Separator lines for UITableViewCellStyleSubtitle cells not taking the full width) in Swift
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell = tableView.dequeueReusableCellWithIdentifier("yourcell") as! UITableViewCell
if (cell.respondsToSelector("setPreservesSuperviewLayoutMargins:")){
cell.layoutMargins = UIEdgeInsetsZero
cell.preservesSuperviewLayoutMargins = false
}
}
By Checking version number :
let floatVersion = (UIDevice.currentDevice().systemVersion as NSString).floatValue
if (floatVersion > 8.0){
cell.layoutMargins = UIEdgeInsetsZero
cell.preservesSuperviewLayoutMargins = false
}