I have got custom UITableViewCell
and not able set indentation in cellForRow: atIndexPath:
.
cell.indentationWidth = 10.0
cell.indentationLevel = indexTuples.count //Dynamic
However, this works if iOS provided default cell label :
cell.textLabel?.text = "TEST"
Is there any restriction? How can I solve this ?
Note: I have to use Autolayout
.
UPDATE:
As per comments, I referred here, I gave a try with below code which doesn't seems to be helpful.
override func layoutSubviews() {
super.layoutSubviews()
self.contentView.layoutMargins.left = CGFloat(self.indentationLevel) * self.indentationWidth
self.contentView.layoutIfNeeded()
}