I am creating my buttons (and other objects) programatically, as that is what I prefer. See below example:
let loginButton: UIButton = UIButton( frame: CGRect( x: 0, y: 0, width: UIScreen.mainScreen().bounds.width / 1.5, height: 50 ) )
Here I create a button that is screen width / 1.5 wide and 50px heigh. This size is perfect for an iPhone 4s resolution and all other devices, horizontally, as it takes the screen width into account. However, naturally, when running on a larger resolution device like the iPhone 6/6+, the buttons are still 50px tall, which is small and leaving a lot of content space empty.
I am sure there is a way to probe the content scale programatically so I can calculate the correct height for my buttons, depending on the device size.
I'm fairly new to Apple's Api's and a shove in the right direction, or a small example would be great.
PS: I want to continue creating my interfaces programatically, not using interface builder. So please refrain from suggesting anything of that sort.
Thanks in advance.