I have a dynamic table view in grouped style and different custom cells in separate nibs, which then I register in viewDidLoad and add them to the tableview accordingly. In story board I added a uiview under the prototype cell to be my footer inside there's a button. Now because my cells have borders I want to have a left and right margin , but not for the whole tableView , only for the cells . I did use this code :
self.tableView.contentInset = UIEdgeInsetsMake(0, 10, 0, 10);
but doing this , my footer doesn't have the width of the screen anymore.
I looked in the web and found some people use this:
import UIKit
class MyTableViewCell: UITableViewCell {
override func layoutSubviews() {
super.layoutSubviews()
contentView.frame = UIEdgeInsetsInsetRect(contentView.frame, UIEdgeInsetsMake(0, 16, 0, 16))
}
}
but this doesn't do anything.
Note that viewForHeaderinSection and viewForFooterInSection are used on my application. Any suggestions please. Thank you
self.tableView.contentInset = UIEdgeInsetsMake(0, 10, 0, 10)
. I did do that but as I said the margin is also applied to the footer and I don't want that