I'm wondering how can I create a UIButton programmatically with a dynamic height depending of the device. Let's say that I create the button like this:
bigButton = BigButton(frame: CGRect(x: 0, y: 0, width: self.view.frame.width , height: 60))
When setting the height, I need to put an integer, but I would like this to be 60px if display is for iPhone 6, 50px if iPhone 5... and so on.
I know how to do that if I create the button with IB, using the constraints and I could use a percentage height proportion, but since I need to create the button programmatically I'm kind of stuck with that. Thanks in advance!