Am using a custom class for all labels and am assigning two properties at the time of designing. One is autoFont and another is the fontSize which is currently the font size in iPhone 4 inch xib at design time. Here is the class.
the .h file
#import <UIKit/UIKit.h>
@interface CustomLabel : UILabel
@property (nonatomic) IBInspectable BOOL autoFont;
@property (nonatomic) IBInspectable CGFloat fontSize;
@end
and here is the .m file
#import "CustomLabel.h"
@implementation CustomLabel
@synthesize autoFont;
@synthesize fontSize;
- (void)layoutSubviews
{
[super layoutSubviews];
if (autoFont) {
float newFontSize = [UIScreen mainScreen].bounds.size.height * (fontSize / 568.0);
if ([UIScreen mainScreen].bounds.size.height < 500) {
newFontSize = [UIScreen mainScreen].bounds.size.height * (fontSize / 480.0);
}
self.font = [UIFont fontWithName:self.font.fontName size:newFontSize];
}
}
@end
i think this is the easiest solution for this kind of problem and also i have did this same thing with buttons and text fields by using custom class.