So I'm trying to add a UISwitch to my table cells on the right. I first tried adding it to the accesoryView, but when I entered to editing mode in the table, the UISwitch dissapeared. So now I added it to the contentView, which is working great, no dissapearing. But it adds it to the top left corner.
So I'm trying to add it to the right but I want to stay away of absolute values in order to support all sizes and orientations.
So I'm trying with this code:
[[cell contentView] addSubview:switchView];
switchView.frame = CGRectMake(cell.contentView.frame.size.width -
switchView.frame.size.width,
0,
switchView.frame.size.width,
switchView.frame.size.height);
But this is what I'm getting:
Any ideas how can I fix this?