7

After iOS 8 Apple introduce size classes which is very helpful for the developer. But they give the different font sizes for all iPhones (iPhone 4s , iPhone 5, iPhone 5s, iPhone 6) and iPhone 6 plus, So is there any possible correct way to do the same in iPhone 5 and iPhone 6 .....

I don't want checks please like this Set different font size for iPhone 5 and 6

Your suitable and best answer is much appreciated.

Community
  • 1
  • 1
Raheel Mateen
  • 245
  • 2
  • 13

1 Answers1

0

Use below macro -

// 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 will help you

Santu C
  • 2,528
  • 2
  • 10
  • 20
  • thank you but i found much better answer here http://stackoverflow.com/questions/27065929/size-class-to-identify-iphone-6-and-iphone-6-plus-portrait – Raheel Mateen May 22 '15 at 06:30