I have a problem with Cocoa Auto Layout and can\'t get my head around this problem. All I\'d like to achieve is to have two buttons always centered in a view as depicted below.<
Great tips. In my case i wanted the buttons to be centered 10 pixels apart from the center of my view so my math is slightly different
leadingConstraint.constant = (self.frame.size.width / 2.0) + 5.0; trailingConstraint.constant = (self.frame.size.width / 2.0) + 5.0;