I would use:
child.center = CGPointMake(parent.bounds.height / 2, parent.bounds.width / 2)
This is simple, short, and sweet. If you use @Hejazi's answer above and parent.center
is set to anything other than (0,0)
your subview will not be centered!