You cannot change the position of a accessoryView
. Please refer to the following question:
Can a standard accessory view be in a different position within a UITableViewCell?
It is okay for you to apply transformation such as scale, and rotation to the accessory view. However, you are not able to apply translate transformation to the accessory view. For example,
switchView.transform = CGAffineTransformTranslate(CGAffineTransformMakeScale(0.5, 0.5),10,10);
Only the scale part of the transformation is applied to the switchView
. Looking through the apple documentation, I also found this following line of note:
... The accessory view appears in the right side of the cell.
I don't think apple do want you to customized the location of the accessory view. Based on your question, I also tried changing the centre and the frame of the accessoryView, I do notice that the position of the accessoryView is not moving at all.
In short, If you really want to change the size of the UISwitch
and move it to the vertical align it in the table view cell, I think you have only one option: You will have to add UISwitch
as a subview of the cell and then you will have to freedom to do whatever you want.