Dynamically set font size in iphone 5 and iphone 6

After iOS 8 Apple introduces class classes that are very useful for the developer. But they give different font sizes for all iPhone (iPhone 4s, iPhone 5, iPhone 5s, iPhone 6) and iPhone 6 plus. So is there a possible right way to do the same in the iPhone 5 and iPhone 6 .....

I do not need checks, please Set a different font size for iPhone 5 and 6

Your suitable and best answer is greatly appreciated.

+8
ios fonts iphone-5 iphone-6
source share
1 answer

Use the macro below -

// I assume that iPhone 5 Font size 17.0 and iPhone 6 font size 25.0 and default font size 12.0 #define kFONTSize ([UIScreen mainScreen].bounds.size.height == 568 ? 17.0 :[UIScreen mainScreen].bounds.size.height == 667? 25.0: 12.0) #define kFONT_DEFINE [UIFont fontWithName:AVENIR_LTPRO size:kFONTSize] txtView.font = kFONT_DEFINE; 

Hope this helps you

0
source share

All Articles