You can define a macro to determine the size of the screen, for example:
#define isiPhone4 ([[UIScreen mainScreen] bounds].size.height == 480)?TRUE:FALSE
Later in the code, you can do something like this:
if (isiPhone4) {
self.constraint.constant = NEW_VALUE;
}
To access the storyboard lines from the code, you have to do them IBOutlets(control + drag them to your controller, like everything else).

source
share